-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
43 lines (43 loc) · 1 KB
/
contact.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>提交页面</title>
<?php require('include/start.php'); ?>
</head>
<body>
</body>
</html>
<?php
if (isset($_POST['name']) and isset($_POST['email']) and isset($_POST['message'])){
include "install/config.php";
$conn = mysqli_connect($servername, $username, $password, $db);
if (!$conn){
die("数据库连接失败<br>"."原因:".mysqli_connect_error());
}
$sql=$conn->prepare("INSERT INTO $dbb (name,email,subject,message,reply,avatar) VALUES (?,?,?,?,?,?)");
$sql->bind_param("ssssss",$name,$email,$subject,$message,$reply,$avatar);
if (isset($_POST['subject'])){
$subject=$_POST['subject'];
}
else{
$subject="";
}
$name=$_POST['name'];
$email=$_POST['email'];
$message=$_POST['message'];
$reply="";
$get=getUser();
$avatar=$get["avatar"];
//die($avatar);
$sql->execute();
$sql->close();
$conn->close();
modal("留言提交","成功");
echo "<script>setTimeout(\"window.location='../'\",1500)</script>";
//setTimeout("",1000)
}
else{
die("参数不完整");
}
?>