日期:2014-05-17  浏览次数:20908 次

请问为什么我的网页按添加删除都没有反应
如题,我用的是PHP和mySQL,是不是要把添加和删除的代码分到另一个文件来写
<body bgcolor="d9dffaa">
  <div align="center"><font face="幼圆" size="5" color="#008000">
  <b>学生信息录入</b></font></div>
<form name="frm1" method="post" action="AddStu.php" style="margin:0">
<table width="340" align="center">
<tr><td width="168"><span class="STYLE1">根据学号查询学生信息:</span></td>
  <td><input name="StuNumber" id="StuNumber" type="text" size="10">
  <input type="submit" name="test" class="STYLE1" value="查找"></td></tr>
</table>
</form>
<?php
require "fun.php";
session_start(); //启动SESSION
$number=@$_POST['StuNumber']; //获取学生号
$_SESSION['number']=$number; //讲学生号值传给其他页面
$sql="select*from XSB where XH='$number'"; //查找该生信息
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
if(($number!==NULL)&&(!$row)) //判断学号是否存在
  echo "<script>alert('没有该学生信息!')</script>";  
$timeTemp=strtotime($row['CSSJ']); //将日期解析为UNIX时间戳
$time=date("Y-n-j",$timeTemp); //用date函数将时间转换为"年-月-日"
?>
<form name="frm2" method="post" style="margin:0" enctype="multipart/form-data">
<table bgcolor="#cccccc" width="430" border="1" align="center" cellpadding="0" cellspacing="0">
<tr><td bgcolor="#ccccccc" width="90"><span class="STYLE1">学号</span></td>
  <td><input name="StuNum" type="text" size="35" class="STYLE1" value="<?php echo $row['XH'];?>">
  <input name="h_StuNum" type="hidden" value="<?php echo $row['XH'];?>"></td></tr>
<tr><td bgcolor="#CCCCCC" width="90"><span class="STYLE1">姓名:</span></td>
  <td><input name="StuName" type="text" size="35" class="STYLE1" value="<?php echo $row['XM'];?>"></td></tr>
<tr><td bgcolor="#CCCCCC"><div class="STYLE1">性别</div></td>
  <?php
  if($row['XB']===0)
  {?>
  <td><input type="radio" name="Sex" value="1"><span class="STYLE1">男</span>
  <input type="radio" name="Sex" value="0" checked="checked"><span class="STYLE1">女</span></td>
  <?php
  }
  else
  {?>
  <td><input type="radio" name="Sex" value="1" checked="checked"><span class="STYLE1">男</span>
  <input type="radio" name="Sex" value="0"><span class="STYLE1">女</span></td>
  <?php
  }
  ?>
  </tr>
<tr><td bgcolor="#CCCCCC"><span class="STYLE1">出生日期:</span></td>
  <td><input name="Birth