Passing values to another php page using anchor ta

2019-04-01 19:38发布

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?

标签: php anchor
4条回答
一夜七次
2楼-- · 2019-04-01 19:51

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 ?

查看更多
对你真心纯属浪费
3楼-- · 2019-04-01 19:55

Delete the spaces before and after the '=':

<A HREF="Delete.php?PID=<?php echo $row['PersonID']; ?>"> Delete </A>
查看更多
▲ chillily
4楼-- · 2019-04-01 20:05

Get rid of the space in your URL:

<a href="Delete.php?PID=<?php echo $row['PersonID']; ?>"> Delete </a>
查看更多
SAY GOODBYE
5楼-- · 2019-04-01 20:12

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.

查看更多
登录 后发表回答