...

View Full Version : If my $data contains a '&' how do I send it in url ?



jeddi
01-30-2010, 04:35 PM
Hi,

I am sending the category name over with the url
so it can be collected with the GET. using this:


http://www.example.com/sys/detail.php?pd=$prod&a=$cat_name


The problem occurs when the $cat_name is
"Cooking & Wine" or "Cats & Dogs"
then I just get "Cooking" or "Cats" come over.

Do I need to change the &'s to plus signs (+)
or maybe 'and' ? or is there a method to send the &'s ?



.

_Aerospace_Eng_
01-30-2010, 04:53 PM
Use urlencode($cat_name) when you are sending it and urldecode($_GET['a']) when you are reading it out again. $_GET['a'] would be your query string you are trying to get.

jeddi
01-30-2010, 07:01 PM
Thanks,
another little thing learnt :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum