note 69639 deleted from reserved.variables by philip

From: Date: Wed, 21 Feb 2007 15:51:04 +0000
Subject: note 69639 deleted from reserved.variables by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-123638@lists.php.net to get a copy of this message
Note Submitter: kancsal dot zoltan at proaction dot hu ---- Note that PHP_SELF is incorrect if you use script as directory name. Here is a workaround I used: if(gentenv('PATH_INFO')){ $HTMLBASE=getenv("SERVER_NAME"); $d=explode("/",$_SERVER["PHP_SELF"]); for($i=1;$i<count($d)-1;$i++){if(substr($d[$i],-4)==".php") break;$HTMLBASE.="/".$d[$i];} $_SERVER["PHP_SELF"]="http://".$HTMLBASE."/".$d[$i]; $PHP_SELF=$_SERVER["PHP_SELF"]; } This will set a correct value to PHP_SELF if you use .php extensions.

« previous php.notes (#123638) next »