Click to See Complete Forum and Search --> : $PHP_SELF not displaying at all..


xtort0
07-02-2002, 03:29 PM
here is a test script i ran from my server;

<?php
// test to try and fin working php_self! //

echo "<b>php_self test:</b><br>";
echo "phpself1: {$_SERVER['PHPSELF']}<br>";
echo "phpself2: $PHP_SELF<br>";
echo "phpself3: {$_SERVER["PHPSELF"]}<br>";
echo ("$PHP_SELF");
print ("$PHP_SELF");
echo $PHP_SELF;
echo "$SCRIPT_NAME";

?>

after running the script i still got a blank page.

im running php 4.21 with iis5/win2k
-register_globals= off ...

anyone have any ideas why this isnt working? any input would be appreciated. thanks,

keith

Anon
07-02-2002, 03:51 PM
ok, i added two more lines to the test script, and was able to get one of them to output correctly:

...
echo \"<a href=\\\"$php_self\\\">test1</a>\";
echo \"<a href=\\\"$php_self?\\\">test2</a>\";
...

the first one outputted
\"http://server.com/php/\"

the second one outputted

\"http://server.com/php/test.php\"

hopefuly this will fix my problems.. im still curious though is it possible to echo out $PHP_SELF without using it in a url?