note 13537 added to language.variables.predefined.php

From: Date: Wed, 20 Jun 2001 22:27:28 +0000
Subject: note 13537 added to language.variables.predefined.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-14504@lists.php.net to get a copy of this message
I found a bug with $PHP_SELF. In Win98 running Apache and PHP 4.0.4pl1, $PHP_SELF returns /php/php.exe/cM/index.php. But uploading the file to a Linux Web server running Apache and the same version of PHP yields this from $PHP_SELF: /index.php Using strrchr($PHP_SELF, "/") returns the same result as you get on Linux and will not return any odd results by leaving it in the code. This might lead some people to think that $PHP_SELF will not work to get the current running file, even from an included script, when it does. What led me to find this was the post by jccann@home.com. He said to use $PATH_INFO as it returned a more logical string. My findings were the same, until I uploaded the script to the server and it failed to work. It seems $PATH_INFO does not work on Linux and PHP ver 4.0.4pl1. http://www.php.net/manual/en/language.variables.predefined.php

« previous php.notes (#14504) next »