RogerInHawaii Posted June 17, 2007 Share Posted June 17, 2007 Within some PHP code I'm constructing a URL that includes some variables that I want to pass along with the URL. Something like www.MyWebSite.com/PageTwo.php?Param1=32. I intend to use this constructed URL within a META tag that will cause it to jump to that page. For example: echo '<META http-equiv="refresh" content="0;URL=www.MyWebSite.com/PageTwo.php?Param1=32">'; That works fine. It does indeed jump to that page an dthe parameter is indeed included in the URL when it gets there. But how then do I retrieve the values I passed? How do I get that Param1=32? I initially thought that this would constitute something comparable to a GET type of form submit, so that the values would be available via the PHP $_GET function ( e.g. $TheParam = $_GET['Param1'] ) but that doesn't work. Is there a method for retrieving parameters passed by URL? Or, alternatively, is there a way I can get that META tag to do a GET type submit? Link to comment https://forums.phpfreaks.com/topic/55920-receiving-values-via-url/ Share on other sites More sharing options...
chigley Posted June 17, 2007 Share Posted June 17, 2007 $_GET is the correct method. echo "<pre>".print_r($_GET,true)."</pre>"; Use that to see what is being handed with GET. Link to comment https://forums.phpfreaks.com/topic/55920-receiving-values-via-url/#findComment-276255 Share on other sites More sharing options...
PC Nerd Posted June 17, 2007 Share Posted June 17, 2007 or $_REQUEST if your not sure if its post of get etc. Link to comment https://forums.phpfreaks.com/topic/55920-receiving-values-via-url/#findComment-276348 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.