<?php
require_once("dbConnect.inc");
require_once("myOperation.inc");
$conn = sql_connect();
mysql_select_db("gateway_data"); $conn = sql_connect();
mysql_select_db("gateway_data");
$exec="select * from contents1 where id=".$_GET['id'];
$exec1="update contents1 set name='".$_POST['name']."',
daily_date='".$_POST['daily_date']."',
project_name='".$_POST['project_name']."',
content='".$_POST['content']."',
opinion='".$_POST['opinion']."' where id=".$_GET['id'];
$result=mysql_query($exec1);
if( $result>0)
echo "修改日报成功!" ;
else
echo "修改日报失败……";
echo "<p><a href=report_test.php ><center>返回主页面</center></a>";
mysql_close();
?>
<html><head><meta http-equiv='Refresh' content='2; URL=report_test.php'>
<link href="sinoStyle/stylew.css" rel="stylesheet" type="text/css"></head>
<body><p align="center"></p></body></html>
这个是一个修改页面的逻辑页面,为什么不能修改成功呢?坐等高手回答结贴
require_once("dbConnect.inc");
require_once("myOperation.inc");
$conn = sql_connect();
mysql_select_db("gateway_data"); $conn = sql_connect();
mysql_select_db("gateway_data");
$exec="select * from contents1 where id=".$_GET['id'];
$exec1="update contents1 set name='".$_POST['name']."',
daily_date='".$_POST['daily_date']."',
project_name='".$_POST['project_name']."',
content='".$_POST['content']."',
opinion='".$_POST['opinion']."' where id=".$_GET['id'];
$result=mysql_query($exec1);
if( $result>0)
echo "修改日报成功!" ;
else
echo "修改日报失败……";
echo "<p><a href=report_test.php ><center>返回主页面</center></a>";
mysql_close();
?>
<html><head><meta http-equiv='Refresh' content='2; URL=report_test.php'>
<link href="sinoStyle/stylew.css" rel="stylesheet" type="text/css"></head>
<body><p align="center"></p></body></html>
这个是一个修改页面的逻辑页面,为什么不能修改成功呢?坐等高手回答结贴
$name = $_POST['name'];
$exec="select * from contents1 where id=$fid";
$exec1="update contents1 set name='$name'";不要省事,‘’中间的是不需要浏览器解析,”“中间是需要解析,如果混起来就会出错,没有值
这个有值吗,是post方式吗,url是什么
$result=mysql_query($exec);
$rs=mysql_fetch_object($result);
$id=$rs->id;
A页面通过form表单POST提交给B,让B完成修改功能的处理。现在在B页面取不到这个ID值……
<input type="hidden" value="<?php echo $id; ?>" name="id" >B页面通过 $_POST['id'] 来获取就行了。将 $_POST['id'] 替换 $_GET['id'] 就行了。