2011-12-17 66 views
0

我该如何超链接一个图像,并通过它也传递一个变量?我的不正确的代码如下:通过图像超链接传递变量?

<?php 
      $result=mysql_query("select serial, name, price from products ORDER BY RAND() LIMIT 3"); 
      while($row=mysql_fetch_array($result)) 
      { 
       echo '<a href="searchedproduct.php?product_id=<?=$row['serial']?>"><img src="getImage.php?id=' . $row['serial'] .'"/></a>'.'&nbsp;'.'&nbsp;'; 
} 

echo "</tr>"; 
echo "</table>"; 
?> 

感谢您的帮助球员

回答