PHP URL传递参数问题

<a href="update_post.php?title="' . $row['post_title'] . '&content=' .$row['post_content'].'>修改</a>   
<a href="del_post.php">删除</a></p>';
update_post.php这边:$title= $title=$_GET['title'];怎么是空的,浏览器的地址栏显示空。

第1个回答  2011-11-28
<a href="update_post.php?title=".$row['post_title']."&content=".$row['post_content']>
第2个回答  2011-11-28
<a href="update_post.php?title=<php? echo $row['post_title'] ?>&content=<?php echo $row['post_content']?>">修改</a>
<a href="del_post.php">删除</a></p>
最好把html不放到echo里,虽然麻烦写着,但是效率比较高

放到echo里:
echo "<a href='update_post.php?title=". $row['post_title'] ."&content=".$row['post_content']."'>修改</a> <a href='del_post.php'>删除</a></p>";

那样取值应该没错,如果取不到,那肯定是$row['post_title'] 这个字段本来就是空字段,你可以打印出来看看追问

$title=$row['post_title'];$content=$row['post_content'];$num=($i+1);echo "修改 删除
";
这样解决,你的也对,很透彻!谢谢

本回答被提问者采纳