Jump to content

mypage.php?X=Y not included in PHP_SELF??


Mattyspatty

Recommended Posts

i have a form that will target the current page, including any GET vars.

heres one example -> [a href=\"http://localhost/game/main.php?page=login\" target=\"_blank\"]http://localhost/game/main.php?page=login[/a]

but when using PHP_SELF i only get this -> /game/main.php


im sure i managed to do this at one point, but my minds gone blank and ive upgraded and formatted my PC since then so i have lost any trace of it!

i had a quick search, didnt find any answers. thanks in advance!
Link to comment
Share on other sites

[!--quoteo(post=367206:date=Apr 21 2006, 02:58 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Apr 21 2006, 02:58 PM) [snapback]367206[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Do something like this:

[code]$_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'][/code]

$_SERVER['QUERY_STRING'] gets everthing after the ? in the url.
[/quote]



thanks this helped, but i found this on PHP.net

rather than using
<?=$_SERVER['PHP_SELF']?>
or <? echo $_SERVER['PHP_SELF']?>


this:
<? $_SERVER['PHP_SELF']?> (no 'printing')

will not show an action but WILL keep the variables!



wheres the bloody solved button got to??
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.