robert123 Posted April 22, 2009 Share Posted April 22, 2009 Hi, this is probably something very simple I am missing as I am not to familiar with php, but I have a variable declared as $id and I want to pass it in the url to the next page. I thought you did this by adding this ?value=echo $id; It did not send $id to the next page, is seems to just send "echo". If I leave out the echo and just have ?value=$id; will that work? here is part of my code: <? $landingpage[1] = 'http://www.website.com/page1.php?value=echo $id'; ?> thanks Link to comment https://forums.phpfreaks.com/topic/155269-question-about-using-echo/ Share on other sites More sharing options...
tang Posted April 22, 2009 Share Posted April 22, 2009 I assume that you are echoing the value of $landingpage[1] later in your page, if so: $landingpage[1] = 'http://www.website.com/page1.php?value='.$id; If you do need to show the landingurl you've just assigned to the variable just do: echo $landingpage[1]; Link to comment https://forums.phpfreaks.com/topic/155269-question-about-using-echo/#findComment-816902 Share on other sites More sharing options...
mike12255 Posted April 22, 2009 Share Posted April 22, 2009 try this: $landingpage[1] = "http://www.website.com/page1.php?value=$id"; Link to comment https://forums.phpfreaks.com/topic/155269-question-about-using-echo/#findComment-816903 Share on other sites More sharing options...
cringe Posted April 22, 2009 Share Posted April 22, 2009 Doesn't that need to use rawurlencode() ? $landingpage[1] = 'http://www.website.com/page1.php?value=' . rawurlencode($id); Chris Link to comment https://forums.phpfreaks.com/topic/155269-question-about-using-echo/#findComment-816945 Share on other sites More sharing options...
Gighalen Posted April 22, 2009 Share Posted April 22, 2009 <? $landingpage[1] = 'http://www.website.com/page1.php?value=$id'; ?> or <? $landingpage[1] = 'http://www.website.com/page1.php?value='.$id; ?> Link to comment https://forums.phpfreaks.com/topic/155269-question-about-using-echo/#findComment-816951 Share on other sites More sharing options...
robert123 Posted April 23, 2009 Author Share Posted April 23, 2009 Thanks everyone, I got it working now. $landingpage[1] = 'http://www.website.com/page1.php?value='.$id; That did the trick. Link to comment https://forums.phpfreaks.com/topic/155269-question-about-using-echo/#findComment-817028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.