yong Posted April 2, 2007 Share Posted April 2, 2007 i look some codes like : $PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; when i test in my computer like <?php var_dump($_SERVER['PHP_SELF']); var_dump($_SERVER['SCRIPT_NAME']); ?> is was print :string(14) "/test/demo.php" string(12) "/php/php.exe"; just like you see the both are not same. so i want to know ...why? why the $_server['script_name'] and the $_server['php_self'] are different? thinks.. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted April 2, 2007 Share Posted April 2, 2007 'PHP_SELF' = The filename of the currently executing script, relative to the document root If PHP is running as a command-line processor this variable contains the script name since PHP 4.3.0. Previously it was not available. 'SCRIPT_NAME' = Contains the current script's path Quote Link to comment Share on other sites More sharing options...
yong Posted April 3, 2007 Author Share Posted April 3, 2007 yeah ,but in my opinion ,the script's path is "/test/demo.php" but the $_SERVER['SCRIPT_NAME'] is print "/php/php.exe". so it's wrong,i think. Quote Link to comment Share on other sites More sharing options...
per1os Posted April 3, 2007 Share Posted April 3, 2007 No, its a "bug" in php when installed as CGI. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.