Mattyspatty Posted April 21, 2006 Share Posted April 21, 2006 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.phpim 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! Quote Link to comment https://forums.phpfreaks.com/topic/8046-mypagephpxy-not-included-in-php_self/ Share on other sites More sharing options...
wildteen88 Posted April 21, 2006 Share Posted April 21, 2006 Do something like this:[code]$_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'][/code]$_SERVER['QUERY_STRING'] gets everthing after the ? in the url. Quote Link to comment https://forums.phpfreaks.com/topic/8046-mypagephpxy-not-included-in-php_self/#findComment-29347 Share on other sites More sharing options...
Mattyspatty Posted April 21, 2006 Author Share Posted April 21, 2006 [!--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?? Quote Link to comment https://forums.phpfreaks.com/topic/8046-mypagephpxy-not-included-in-php_self/#findComment-29350 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.