<html> <head><title>员工信息表</title></head> <center> <h1>员工信息表</h1> <form method="POST" action="add_html.php"> id :<input type="text" name="txtid"><br> 姓名 :<input type="text" name="txtname"><br> 所属部门:<input type="text" name="txtdept"><br> 出生日期:<input type="text" name="txtbirth"><br> 入职时间:<input type="text" name="txttime"> </form> <input type="submit" name="ok" value="提交"> <input type="reset" value="重填"></center> </html> <?php include "mysqlconnect.php"; if(isset($_POST['ok'])) { $id=$_POST['txtid']; $name=$_POST['txtname']; $dept=$_POST['txtdept']; $birth=$_POST['txtbirth']; $time=$_POST['txttime']; $sql="insert into zy(id ,姓名,所属部门,出生日期,入职时间) values($id,'$name','$dept',$birth,$time)"; $res=mysql_query($sql); if($res) { echo "<script> alert('数据库添加成功');</script>"; echo "<script>window.location.href='showList.php'</script>"; } else { echo "<script> alert('添加失败');</script>"; } } mysql_close($myline); ?>
大大大大鹿眸
灬紫羽
mooc用户18273
wlaiyj520
萧0817xxlqw
hxh_kylin
晚安sp