我尝试将 PersonID 的值从 list.php 传递给 Delete.php。使用锚标签
这是我的代码:
<A HREF = "Delete.php?PID = <?php echo $row['PersonID']; ?>"> Delete </A>
该值已正确传递,但不知何故我没有被重定向到 Delete.php 任何人都可以注意到上述行中的问题吗?
去掉 URL 中的空格:
<a href="Delete.php?PID=<?php echo $row['PersonID']; ?>"> Delete </a>
删除“=”前后的空格:
<A HREF="Delete.php?PID=<?php echo $row['PersonID']; ?>"> Delete </A>
Code is very well written. I don't know about your database fields and your php file naming conventions but this might help you.
<a href="Delete.php?PID=<?=$row['PersonID']?>">Delete</a>
It is same as above but might be it'll helpful. Check your file name delete.php as same in your directory. check your database field name. Is it same you are using ?
如果你有这个:
<a href="Delete.php?PID=<?php echo $row['PersonID']; ?>">Delete</a>
线路不再有问题。您应该检查其他代码。