+function gethost() {
+ $host = $_SERVER ["HTTP_HOST"];
+ $colpos = strpos ($host, ':');
+ // some web clients add port informations in Host header
+ if ($colpos !== false) {
+ $host = substr ($host, 0, $colpos);
+ }
+ return $host;
+}
+
+function basename_safe ($path) {
+ return end (explode ("/", $path));
+}
+