Jump to content
Updating IPB tonight Read more... ×

Archived

This topic is now archived and is closed to further replies.

Mattyspatty

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

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!

Share this post


Link to post
Share on other sites
Do something like this:

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

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

Share this post


Link to post
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??

Share this post


Link to post
Share on other sites

×

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.