ainoy31 Posted August 6, 2007 Share Posted August 6, 2007 i am trying to pass a variable in the url to the next page: http://www.xxx.com/xxx.php?at=$price then, on the xxx.php page i would just use the following command to retrieve the variable: $test = $_GET['at']; wouldn't this be correct? Link to comment https://forums.phpfreaks.com/topic/63612-passing-variable-via-url/ Share on other sites More sharing options...
AndyB Posted August 6, 2007 Share Posted August 6, 2007 That would be correct. Link to comment https://forums.phpfreaks.com/topic/63612-passing-variable-via-url/#findComment-316982 Share on other sites More sharing options...
ainoy31 Posted August 6, 2007 Author Share Posted August 6, 2007 I have this: <a href="http://www.xxx.com/xxx.php?at=$at">Click here to pay for your flight by credit card</a> on the xxx.php, i do $test = $_GET['at']; when i echo $test out, there is no value. it just displays $test on the screen. I double checked the value of $at and there is a value there. I am losing the value between the pages? Thanks, AM Link to comment https://forums.phpfreaks.com/topic/63612-passing-variable-via-url/#findComment-316986 Share on other sites More sharing options...
AndyB Posted August 7, 2007 Share Posted August 7, 2007 I have no interest in visitng your site with that link. Post an example of the code you're using to determine the value of the passed parameter and display it. Link to comment https://forums.phpfreaks.com/topic/63612-passing-variable-via-url/#findComment-317172 Share on other sites More sharing options...
dbo Posted August 7, 2007 Share Posted August 7, 2007 I'm guessing that the xxx is just a generic place holder and not for a porn site Anyways what I'd do is go to the page with that link, and hover over it to see if the link contains the $at variable and $at isn't blank. Cause from what you posted the code looks correct. Sounds to me like the variable is empty or is becoming empty before you attempt to pull it out of the $_GET array. Link to comment https://forums.phpfreaks.com/topic/63612-passing-variable-via-url/#findComment-317213 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.