ex: Mypage.htm
<head></head> <body> <a href="mypage.php?tname=Electrical & Electronics">E&C</a> </body>
mypage.php <?php print($tname); ?>
In mypage.php the value 'Electrical & Electronics' should be displayed. but i am getting the value of $tname as 'Electrical'.
I would use "and" instead of "&". PHP is looking for another variable after the & symbol, that is why it isnt displaying correctly for you.
mypage.php?tname=Electrical%20and%20Electronics
Would be correct.
Your url is being interpreted as tname=Electrical & Electronics=
Cheers
John
This would be the case there there were no spaces on either side of "&". In the example the URL is being cut off at tname=Electrical. The easiest method is to use the urlencode() function.
geoff
hi,
when u assign value to the query string parameter...just urlencode it..thats that...
VARIABLE=urlencode("string with spaces");
hope this solves u r problems...
regards, sachin balsekar.
Hi, U should first urlencode the string, and then pass it as a value.
Regards.