本帖最后由 lovejing2008 于 2014-07-12 17:06:11 编辑 初学php ,试着做了个新闻小例子,在后台编辑、预览某条新闻的时候 ,id传不过来,获取不到对应的内容,麻烦各位帮忙看看
鼠标放在预览、编辑那里 ,显示的地址 是 xxxx/admin/news.php?id=
news.php 页面
news.php 页面
$id=$_GET["id"];
if($_POST["content_id"])
{
$content_id=$_GET["content_id"];
$class=($_POST["class"]);
$classdate=($_POST["classdate"]);
$teacher=($_POST["teacher"]);
}
$sql="select * from fk_content where content_id=$id";
$rs=mysql_query($sql);
$rows=mysql_fetch_assoc($rs);
?>
list.php 页面
target="_blank">浏览
数据库字段如图

拜求各位老师 帮帮忙看下,
------解决方案--------------------
那句改为:
" target="_blank">浏览
另外,print_r($rows); 看看是什么结果。
------解决方案--------------------
------解决方案--------------------
id=" 注意闭合
------解决方案--------------------
target="_blank">浏览
缺少“
------解决方案--------------------
原来PHP格式里不能再加颜色标签,重来:
" target="_blank">浏览
红色部分要在引号里,基础HTML知识。。。。