hia i have a problem with passing passing the & symbol in the url. for example here is a link from my site http://www.ragrecords.co.uk/viewArtist.php?artist=BOB%20MARLEY%20&%20THE%20WAILERS
when clicked its meant to set the artist variable to bob marley & the wailers, but because of the & symbol it splits it up and causes the page to fail.
any ideas on an easy solution? besides not using &...?
cheerrrs
rob
never mind solved it.
used
$newVar = str_replace("&", "%26", $oldVar);
good stuff
Actually, instead of using your own str_replace() implementation, use [man]urlencode/man or [man]rawurlencode/man
john12, your method will not produce valid html but what laserlite suggested will. All special characters in your document need to be encoded.
See what I mean here: http://validator.w3.org/