jakebur01 Posted December 30, 2009 Share Posted December 30, 2009 Hi, I have some data to pull based on type. The variable being passed is B & R. Only, when I try to pass it.. it passes B and cuts off everything else. How can I handle this correctly? echo "<a href=\"view_dealers.php?type=".B .'&'. R."\">Bill and Ralphs</a> - "; elseif ($_GET['type'] == true) { $i = $_GET['type']; echo"$i"; } Quote Link to comment https://forums.phpfreaks.com/topic/186733-ampersand/ Share on other sites More sharing options...
Daniel0 Posted December 30, 2009 Share Posted December 30, 2009 urlencode Quote Link to comment https://forums.phpfreaks.com/topic/186733-ampersand/#findComment-986107 Share on other sites More sharing options...
jakebur01 Posted December 30, 2009 Author Share Posted December 30, 2009 ok... now ?type=B%20&%20R is in my url. and i have this $i = urlencode($_GET['type']); echo"$i"; But, it echos this: B+ Quote Link to comment https://forums.phpfreaks.com/topic/186733-ampersand/#findComment-986111 Share on other sites More sharing options...
jakebur01 Posted December 30, 2009 Author Share Posted December 30, 2009 This new design freaked me out! It looks pretty and everything. But, I was comfortable with the old design. Not sure whether I like it or not. Quote Link to comment https://forums.phpfreaks.com/topic/186733-ampersand/#findComment-986112 Share on other sites More sharing options...
Daniel0 Posted December 30, 2009 Share Posted December 30, 2009 It's the ampersand that you need to urlencode()... Quote Link to comment https://forums.phpfreaks.com/topic/186733-ampersand/#findComment-986115 Share on other sites More sharing options...
jakebur01 Posted December 30, 2009 Author Share Posted December 30, 2009 Could you give me an example please? echo "<a href=\"view_dealers.php?type=B ".urlencode(&)." R\">Bill and Ralphs</a> - "; Quote Link to comment https://forums.phpfreaks.com/topic/186733-ampersand/#findComment-986126 Share on other sites More sharing options...
Daniel0 Posted December 30, 2009 Share Posted December 30, 2009 Well, if it's static you can just do like this: echo '<a href="view_dealers.php?type=R%26B">Bill and Ralphs</a> - "; Quote Link to comment https://forums.phpfreaks.com/topic/186733-ampersand/#findComment-986130 Share on other sites More sharing options...
jakebur01 Posted December 30, 2009 Author Share Posted December 30, 2009 That got it. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/186733-ampersand/#findComment-986135 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.