i want to pass name like steve vai to another page i did like
echo "<a href=test1.php? name=steve vai>linktest</a>";
but it passes only steve. and when i execute echo $name; the ouptput is steve only. but i need the $name as steve vai.
What should i do?
Thx in advance
Read the PHP manual:
http://www.php.net/manual/en/function.rawurlencode.php
Remember this: name="steve vai"
echo "<a href=test1.php? name=\"steve vai\">linktest</a>";
or echo '<a href=test1.php? name="steve vai">linktest</a>';
This version is faster
//babak
The browser thinks the value ends when it encounters a space, so you need to pass the value through the rawurlencode function like vincent says, or if you're handcoding the names in, you can just use 'steve%20vai'
Case you don't understand the explicit area of the PHP Manual that explain it, try:
$name = urlencode("steve vai");
print "<a href=test1.php?name=\"$name\"> linktest </a>";
This basic are related in "String" chapter of PHP Manual...