Php 通过图像超链接传递变量?
如何超链接图像并同时传递变量?我的错误代码如下:Php 通过图像超链接传递变量?,php,Php,如何超链接图像并同时传递变量?我的错误代码如下: <?php $result=mysql_query("select serial, name, price from products ORDER BY RAND() LIMIT 3"); while($row=mysql_fetch_array($result)) { echo '<a href="searchedprod
<?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>'.' '.' ';
}
echo "</tr>";
echo "</table>";
?>
感谢大家的帮助,就像宙斯之书所说的,你有一个语法错误:
<?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>'.' '.' ';
}
echo "</tr>";
echo "</table>";
?>
您的echo'中有语法错误,我看不出有错误,如果您不介意,请您指出给我看!谢谢