PDA

View Full Version : "&" character through "get"



bernard
06-02-2005, 12:56 PM
Hi,
Here is my link :<a href="popup.php?type=bracelets&image=106-e.jpg&description=Turquoise, malachite, horlite & fresh water pearls ">

I want the "&" in description to be recognized as text and not as a variable separator. I tried htmlentities("&") but I can't get the &amp in my rsult page.
The only thing that I have is "Turquoise, malachite, horlite ".

Is there a solution ?

Thanks

Bernard

mwinter
06-02-2005, 02:07 PM
<a href="popup.php?type=bracelets&image=106-e.jpg&description=Turquoise, malachite, horlite & fresh water pearls ">The ampersands that are separators should be included as &amp;. The ampersands that are characters should be included as %26, which is the ASCII value in hexadecimal. The urlencode function will do the latter for you.

Mike

bernard
06-02-2005, 02:44 PM
It works !!!!!
I used urlencode and the link is OK

Thanks

che_rish
06-29-2005, 07:14 AM
I just want to express my thanks to mwinter!

I had a similar problem before and now I found out (and learned) how to fix it. :)

dd2me
06-29-2005, 10:18 AM
try also $_SERVER['QUERY_STRING'] :p, have a nice experiment :D