-1

php code

 echo "<td><a href=?V*".$row['rec_title']."> ". $row['rec_title'] . "</a></td>";

html code

<a href=?V*Venison with Frumenty(British)> Venison with Frumenty(British)</td>

but when i click on the -> Venison with frumenty (british) the link is generate half link example http://ex.com/?Vension

and i want complete link like that http://ex.com/?Venison with Frumenty(British)

how to fix this issue please help me to fix this issue

hakre
  • 193,403
  • 52
  • 435
  • 836
user1796164
  • 131
  • 1
  • 4
  • 14

2 Answers2

0

You should use urlencode (http://php.net/urlencode) to display links like that:

 echo "<td><a href=\"?V*".urlencode($row['rec_title'])."\"> ". $row['rec_title'] . "</a></td>";

urlencode will replace spaces with %20 which is the two-digit hex representation for a space. You should get in the habit of always using urlencode in these scenarios.

Also, as Devang and Class said - don't forget your quotes around your attribute values. Instead of <a href=something></a> do <a href="something"></a>

Adam Plocher
  • 13,994
  • 6
  • 46
  • 79
0

You can use urlencode() to achieve the same.

echo "<td><a href=?V*".urlencode($row['rec_title'])."> ". $row['rec_title'] . "</a></td>";
Achrome
  • 7,773
  • 14
  • 36
  • 45