includes/functions.php
changeset 1223 7dca925b0209
parent 1219 2b13cd6b4f95
child 1226 de56132c008d
--- a/includes/functions.php	Wed Mar 17 14:21:46 2010 -0400
+++ b/includes/functions.php	Sat Mar 20 16:05:38 2010 -0400
@@ -221,7 +221,15 @@
 
 function get_server_url()
 {
-  return 'http' . ( $GLOBALS['is_https'] ) . '://' . $_SERVER['HTTP_HOST'];
+  $server_name = false;
+  if ( isset($_SERVER['HTTP_HOST']) )
+  	$server_name = $_SERVER['HTTP_HOST'];
+  else if ( isset($_SERVER['SERVER_NAME']) )
+  	$server_name = $_SERVER['SERVER_NAME'];
+  else
+    $server_name = 'localhost';
+  
+  return 'http' . ( $GLOBALS['is_https'] ) . '://' . $server_name;
 }
 
 /**