nathanmaxsonadil Posted September 27, 2007 Share Posted September 27, 2007 I was wondering how to get everything after the ? in a url? I need to have a file redirect with all it's GET variable's.. Link to comment https://forums.phpfreaks.com/topic/70933-get-varible-redirect/ Share on other sites More sharing options...
pocobueno1388 Posted September 27, 2007 Share Posted September 27, 2007 I think $_SERVER['REQUEST_URI'] Is what your looking for. If not, just put this code on the page and look for the output your looking for, and use that server variable. <?php echo '<pre>'; print_r($_SERVER); echo '</pre>'; ?> Link to comment https://forums.phpfreaks.com/topic/70933-get-varible-redirect/#findComment-356582 Share on other sites More sharing options...
nathanmaxsonadil Posted September 27, 2007 Author Share Posted September 27, 2007 that would work but I would want everything after a ? how would I do that? Link to comment https://forums.phpfreaks.com/topic/70933-get-varible-redirect/#findComment-356585 Share on other sites More sharing options...
wildteen88 Posted September 27, 2007 Share Posted September 27, 2007 Use $_SERVER['REQUEST_URI'] instead. This includes everything after the domain name, eg it'll return: foo/bar.php?woo=noo if the url is www.example.com/foo/bar.php?woo=noo Link to comment https://forums.phpfreaks.com/topic/70933-get-varible-redirect/#findComment-356592 Share on other sites More sharing options...
nathanmaxsonadil Posted September 27, 2007 Author Share Posted September 27, 2007 that would work but I would want everything after a ? how would I do that? I did this with an explode Link to comment https://forums.phpfreaks.com/topic/70933-get-varible-redirect/#findComment-356593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.