markcunningham07 Posted July 16, 2010 Share Posted July 16, 2010 Hi i need to get my url after ? sign. http://example.com/flash/welcome.php?firstname=name+&lastname=makr+&numer=45+ I want to get only firstname=name+&lastname=makr+&numer=45+ can any one help me out Right now i use code below to get URL <td> <?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } ?> <?php echo curPageURL(); ?> </td> Link to comment https://forums.phpfreaks.com/topic/207905-get-a-part-of-url/ Share on other sites More sharing options...
Pikachu2000 Posted July 16, 2010 Share Posted July 16, 2010 Did you look at $_SERVER['QUERY_STRING']? Link to comment https://forums.phpfreaks.com/topic/207905-get-a-part-of-url/#findComment-1086841 Share on other sites More sharing options...
markcunningham07 Posted July 16, 2010 Author Share Posted July 16, 2010 Thanks a lot QUERY_STRING works perfect. Thank you Link to comment https://forums.phpfreaks.com/topic/207905-get-a-part-of-url/#findComment-1086849 Share on other sites More sharing options...
Pikachu2000 Posted July 16, 2010 Share Posted July 16, 2010 You're welcome. It'll be bit less cumbersome too, I'd imagine. Link to comment https://forums.phpfreaks.com/topic/207905-get-a-part-of-url/#findComment-1086851 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.