问题
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