soulbriski Posted July 31, 2008 Share Posted July 31, 2008 How do you pass the ampersand (&) as part of the parameter? My site is written in php and the example shown below would in fact be "echoed" and the clubname would be a variable etc etc etc. For ease of understanding a typical HTML example would be <a href="MyURL/leaguetables.php?clubname=George & Dragon">Show Club</a> Of course the '&' is going to break it because it thinks the space after the '&' in George & Dragon is the next parameter! I have tried putiing the club name inside quotes and "str_replacing" it with '&" etc but i cant get round the problem. Can someone help me? Link to comment https://forums.phpfreaks.com/topic/117567-solved-passing-the-amp-as-part-of-the-parameter/ Share on other sites More sharing options...
rhodesa Posted July 31, 2008 Share Posted July 31, 2008 <a href="MyURL/leaguetables.php?clubname=<?php echo rawurlencode("George & Dragon"); ?>">Show Club</a> aka <a href="MyURL/leaguetables.php?clubname=George%20%26%20Dragon">Show Club</a> Link to comment https://forums.phpfreaks.com/topic/117567-solved-passing-the-amp-as-part-of-the-parameter/#findComment-604668 Share on other sites More sharing options...
soulbriski Posted August 1, 2008 Author Share Posted August 1, 2008 Thanks very much Rhodesa. I knew it would be simple but I just struggled to find the syntax. Thanks Link to comment https://forums.phpfreaks.com/topic/117567-solved-passing-the-amp-as-part-of-the-parameter/#findComment-605316 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.