Passing along variable inside link works only on first word in multiple-word-variables, why?
Posted
by Camran
on Stack Overflow
See other posts from Stack Overflow
or by Camran
Published on 2010-04-18T12:09:18Z
Indexed on
2010/04/18
12:13 UTC
Read the original article
Hit count: 254
I have this code below. As you can see I am passing two variables along with the link.
The second variabye (category) works whenever it consists of one word, but some categories are two words or more, and then on the receiving php page where I fetch the variable only the first word is fetched.
Any ideas?
Example: I pass along this: Rims & Tires
Only this comes through: Rims
$display_table .= "<a href='../ad.php?ad_id=$row[ad_id]&category=$row[category]' target='_parent'>";
Here is how I fetch it in the receiving php file (which the link is to):
$cat = $_GET['category'];
echo $cat; //displays only first word of multiple word categories.
Thanks
© Stack Overflow or respective owner