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.. Link to comment https://forums.phpfreaks.com/topic/45241-question-about-php_self-and-script_name/ 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 Link to comment https://forums.phpfreaks.com/topic/45241-question-about-php_self-and-script_name/#findComment-219678 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. Link to comment https://forums.phpfreaks.com/topic/45241-question-about-php_self-and-script_name/#findComment-220267 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. Link to comment https://forums.phpfreaks.com/topic/45241-question-about-php_self-and-script_name/#findComment-220290 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.