我有这个代码:
if ($topic['user']==$_SESSION['display'])
{
echo '<div class="bottomright"><a href="?id=<?php echo $topic_id; ?>&part=5"><img src="../assets/icons/Comments-edit.png" /></a><a href="?id=<?php echo $topic_id; ?>&part=6"><img src="../assets/icons/Lock.png" /></a><a href="?id=<?php echo $topic_id; ?>&part=7"><img src="../assets/icons/Trash.png" /></a></div>';
}
当我将鼠标悬停在图像上时,链接显示为:
?id=%3C?php%20echo%20$topic_id;%20?%3E&part=3
而不是:
?id=3&part=3
为什么这不起作用?
我试过这个:
if ($topic['user']==$_SESSION['display'])
{
echo '<div class="bottomright"><a href="?id=$topic_id&part=5"><img src="../assets/icons/Comments-edit.png" /></a><a href="?id=$topic_id&part=6"><img src="../assets/icons/Lock.png" /></a><a href="?id=$topic_id&part=7"><img src="../assets/icons/Trash.png" /></a></div>';
}
现在我得到:
?id=$topic_id&part=3