JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added progress-bar uploader.php
[wfpl.git] / http.php
index e325fc1..042e1b9 100644 (file)
--- a/http.php
+++ b/http.php
@@ -45,6 +45,22 @@ function this_url_sans_path() {
        return $url;
 }
 
+# just the hostname, no port number
+function this_host() {
+       if($_SERVER['HTTP_HOST']) {
+               $host = $_SERVER['HTTP_HOST'];
+               $p = strpos($host, ':');
+               if($p) {
+                       $host = substr($host, 0, $p);
+               }
+               return $host;
+       } else {
+               return $_SERVER['SERVER_NAME'];
+       }
+}
+
+
+
 # return our best guess at the url used to access this page
 function this_url() {
        $url = this_url_sans_path();