使用php将id链接到另一个页面

问题描述 投票:0回答:1

我的PHP脚本中有以下代码。但是看不出问题出在哪里。我试图将记录ID与href链接到另一个php页面。在表格显示中,可以看到没有链接的那个。我需要链接的不是。

echo '<td align="right"><a href = "./history.php?cust_id='. $cust_id. '" <?php echo $cust_id;?></a><td>'; // this one does not work

echo '<td align="right">'.$customerName.'</td>'; // no problem with this 

我被这个停了下来。错误在哪里?

php hyperlink href id
1个回答
2
投票

我再次写了它并进行了测试。你不需要另一个php标签,如果你使用echo你已经在php中了:

echo '<td align = right><a href = "./history.php?cust_id='. $cust_id. '">'.$cust_id.'</a><td>';
© www.soinside.com 2019 - 2024. All rights reserved.