$PHP_SELF doesnt work for me

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Sun Dec 29, 2002 1:33 pm

Post your code just in case there's a ayntax error.

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Sun Dec 29, 2002 5:06 pm

ok, in this case you need this -->
echo $_SERVER['PHP_SELF'];

But if you want to use it for links, just use this -->

Code: Select all

echo "<a href=".$PHP_SELF."?>click</a>";

Note that there is an interogant '?'. You need it to get right result, just as if you wanted to add HTTP variables.

bye
:)

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Mon Dec 30, 2002 1:47 pm

jbn wrote:ok, thanks :D

this didnt work:

<?
echo "<a href=".$PHP_SELF.">click</a>";
?>


Yes, I told you in the last post (Look at the note ) :)
You are missing the '?' -->
Look:
echo "<a href=".$PHP_SELF."?>click</a>";

This is the key
bye

Post Reply