Passing values to another php page using anchor tag

纵饮孤独 提交于 2019-12-05 03:40:35

问题


I try to pass value of PersonID from list.php to Delete.php. using anchor tag

Here is my code :

<A HREF = "Delete.php?PID = <?php echo $row['PersonID']; ?>"> Delete </A>

The value is passed correctly but somehow I don't get redirected to Delete.php can anyone note the problem in the above line?


回答1:


Get rid of the space in your URL:

<a href="Delete.php?PID=<?php echo $row['PersonID']; ?>"> Delete </a>



回答2:


Delete the spaces before and after the '=':

<A HREF="Delete.php?PID=<?php echo $row['PersonID']; ?>"> Delete </A>



回答3:


If you have this:

<a href="Delete.php?PID=<?php echo $row['PersonID']; ?>">Delete</a>

No more problem in the line. You should check other code.




回答4:


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 ?



来源:https://stackoverflow.com/questions/16071264/passing-values-to-another-php-page-using-anchor-tag

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!