diff --git a/memcache.php b/memcache.php index e49ed7c..f6547f3 100644 --- a/memcache.php +++ b/memcache.php @@ -50,6 +50,20 @@ ///////////MEMCACHE FUNCTIONS ///////////////////////////////////////////////////////////////////// +/** + * Return the URL to this script so we can + * adjust it via configuration. + * + * @return string + */ +function getUrl() { + $url = MEMCACHE_SCRIPT; + if (substr($url, -1) != '?') { + $url .= '?'; + } + return $url; +} + function sendMemcacheCommands($command){ global $MEMCACHE_SERVERS; $result = array(); @@ -307,7 +321,7 @@ function bsize($s) { // create menu entry function menu_entry($ob,$title) { - global $PHP_SELF; + $PHP_SELF = getUrl(); if ($ob==$_GET['op']){ return "
  • $title
  • "; } @@ -550,7 +564,7 @@ function getFooter(){ } function getMenu(){ - global $PHP_SELF; + $PHP_SELF = getUrl(); echo "