I have a webpage that is passed a string:
http://www.mywebsite.com/gallery.php?gallery=Sand_&_Surf
Using the GET method, I am trying to do this:
$gallery = $_GET['gallery'];
I want to store "Sand_&_Surf" in the $gallery
variable. From there, I do a database query and display all the paintings that are for sale in the "Sand & Surf" gallery. the problem is that '&' is a separator for the GET command, so what ends up in $gallery
is Sand_
.
Ideas of solving this have included changing '&' to "AMPERSAND" in the link, GETTING it, then converting it back. Is that the way to go or is there a better way?