-1

I am trying to create a hyperlink using php. the hyper link is in a table..

this is my code:

 echo"<tr><td>"<a href='".$row['hyperPath'] . ">click here</a></td></tr>"; 

I am getting an error

How can i fix this?

4

2 回答 2

0

It should be

echo"<tr><td><a href='".$row['hyperPath'] . "'>click here</a></td></tr>";

You had an extra " after your tag. If you really want the " to be displayed you need to escape it first with \ like this:

echo"<tr><td>\"<a href='".$row['hyperPath'] . "'>click here</a></td></tr>";

You were also missing the closing quote for your href attribute (added before >click here)

于 2012-12-01T11:04:22.817 回答
0

尝试这个

echo "<tr><td><a href='".$row['hyperPath']."'>click here</a></td></tr>"; 
于 2013-03-08T08:06:51.120 回答