EchoFool Posted June 11, 2009 Share Posted June 11, 2009 Hi there, Like the PHP SELF function im trying to find a function which displays the url the user is on but also the ?get=GET stuff with it... at the moment PHP SELF only shows up to the text.php But if the user was on text.php?get=get Then it still only shows text.php which is a problem. Does anyone know how i can get the GET stuff with it ? Link to comment https://forums.phpfreaks.com/topic/161890-solved-php-self/ Share on other sites More sharing options...
laPistola Posted June 11, 2009 Share Posted June 11, 2009 $_SERVER['QUERY_STRING']; Link to comment https://forums.phpfreaks.com/topic/161890-solved-php-self/#findComment-854136 Share on other sites More sharing options...
J.Daniels Posted June 11, 2009 Share Posted June 11, 2009 $_SERVER['REQUEST_URI'] will show the full uri Link to comment https://forums.phpfreaks.com/topic/161890-solved-php-self/#findComment-854137 Share on other sites More sharing options...
EchoFool Posted June 11, 2009 Author Share Posted June 11, 2009 Whats the difference between the two you both suggested? Link to comment https://forums.phpfreaks.com/topic/161890-solved-php-self/#findComment-854139 Share on other sites More sharing options...
J.Daniels Posted June 11, 2009 Share Posted June 11, 2009 $_SERVER['QUERY_STRING'] contains the portion of the url after the question mark $_SERVER['REQUEST_URI'] contains the full url Link to comment https://forums.phpfreaks.com/topic/161890-solved-php-self/#findComment-854143 Share on other sites More sharing options...
ted_chou12 Posted June 11, 2009 Share Posted June 11, 2009 for the first one u have to do this: echo "{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}"; //but the second just: echo $_SERVER['REQUEST_URI']; //both gives same thing, but the 2nd one is shorter Ted Link to comment https://forums.phpfreaks.com/topic/161890-solved-php-self/#findComment-854144 Share on other sites More sharing options...
EchoFool Posted June 11, 2009 Author Share Posted June 11, 2009 Thanks guys Link to comment https://forums.phpfreaks.com/topic/161890-solved-php-self/#findComment-854153 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.