Jump to content


Photo

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


  • Please log in to reply
2 replies to this topic

#1 Mattyspatty

Mattyspatty
  • Members
  • PipPipPip
  • Advanced Member
  • 76 posts
  • LocationEngland :D

Posted 21 April 2006 - 02:52 PM

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!
ok, so my PHP is a bit rusty... my replies are 90% ok.
the other 10% either have syntax errors or are the "hard solution"
http://www.php.net  http://www.google.com - Are your friends!

I have a C++ problem with 'keybd_event' in certain applications. if you can help me PM me! :P
Needs motivation to create another quick cash website. I need a new TV

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 21 April 2006 - 02:58 PM

Do something like this:

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

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

#3 Mattyspatty

Mattyspatty
  • Members
  • PipPipPip
  • Advanced Member
  • 76 posts
  • LocationEngland :D

Posted 21 April 2006 - 03:03 PM

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

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

$_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??
ok, so my PHP is a bit rusty... my replies are 90% ok.
the other 10% either have syntax errors or are the "hard solution"
http://www.php.net  http://www.google.com - Are your friends!

I have a C++ problem with 'keybd_event' in certain applications. if you can help me PM me! :P
Needs motivation to create another quick cash website. I need a new TV




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users