Page 1 of 1
$PHP_SELF
Posted: Sun Dec 21, 2003 1:44 pm
by thomasd1
why can't i do
<?php echo $PHP_SELF ?> on my localhost?
it works on my lycos webspace ...

Posted: Sun Dec 21, 2003 1:50 pm
by Pyrite
R u missing a ; ?
Posted: Sun Dec 21, 2003 2:47 pm
by Sevengraff
depending on your version and php settings, you might have to do $_SERVER['PHP_SELF'].
Look into register globals at php.net
Posted: Sun Dec 21, 2003 2:49 pm
by Pyrite
good point. Either try <?=$PHP_SELF;?> or <?=$_SERVER['PHP_SELF'];?>
Posted: Sun Dec 21, 2003 4:16 pm
by thomasd1
ok that worked
now i got URLs like:
http://localhost/test/string3.php?strin ... mit=Submit
this also doesn't work on mylocalhost...

Posted: Sun Dec 21, 2003 5:23 pm
by Sevengraff
To get those variables you need to use $_GET:
Code: Select all
echo $_GET['stringy']; // thomas
echo $_GET['Submit']; // Submit
Posted: Mon Dec 22, 2003 3:06 am
by thomasd1
damn, i knew that
