<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<title>工资管理系统页面</title>
</head><body>
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>" method="post">
<input type="text" name="name">
<input type="text" name="age">
<input type="text" name="gender">
<input type="text" name="address">
<input type="text" name="phone">
<input type="text" name="department">
<input type="submit" name="submit" value="提交">
</form>
<?phpif(isset($_POST['submit'])){
include 'db_link.php';
@$name = $_POST['name'];
@$age = $_POST['age'];
@$gender = $_POST['gender'];
@$address = $_POST['address'];
@$phone = $_POST['phone'];
@$d_name = $_POST['department'];
$sql="insert into stuff(name,age,gender,address,phone,D_name) VALUES ('$name','$age','$gender','$address','$phone','$d_name')";
$query=$conn->query($sql);
if(!$query){
echo "<script>alert('提交失败');</script>";
}
}?></body></html>
全部代码如下,就是提交失败,怎么回事?
6 回答
- 6 回答
- 0 关注
- 454 浏览
添加回答
举报
0/150
提交
取消