Jump to content

Hyperlink


user4fun

Recommended Posts

This is beyond my php knowledge.I need $row['website'] value to be a hyperlink opened in a new page.and my image in the next <td> is wrong syntax.Please help in either one,

while($row = mysql_fetch_array($result))  {		  echo "<td>"  . $row['website'] .  "</td>";   	 		echo "<td>" img border="0" src="stars.jpg" width="163" height="30" "</td>";}

Link to comment
Share on other sites

Hi.. you want to do if some one clicks on image then whatever come in $row['website'] via loop that would be open.. isn't it?if am right then you can do that bia following code:---------------------------------------------------------------------------------------------------------------<?phpwhile($row = mysql_fetch_array($result)) { echo "<td> <a href=\"".$row['website']."\" target=\"_blank\"> <img border=\"0\" src=\"stars.jpg\" width=\"163\" height=\"30\"> </a> <td>";}?>---------------------------------------------------------------------------------------------------------------Regards,Vijay

Link to comment
Share on other sites

Replace

echo "<td>" img border="0" src="stars.jpg" width="163" height="30" "</td>";

with

echo "<td><img src=\"stars.jpg\" border=\"0\" width=\"163\" height=\"30\"></td>";

If all images in that array will have the same size, you might want to define them as blocks using css

td:img { display: block; width: x; height: y;}

and just throw the image in there with

<td><img src=\"stars.jpg\"></td>

no success guaranteed tho.

Link to comment
Share on other sites

thank you, i wil.l try it out.

echo "<td><a href=\"".$row['website']."\" target=\"_blank\"></a><td>";

the image works great, the link to $row website is not working. The php file is ran fine but the website column comes up empty

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...