-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessage_action.php
52 lines (44 loc) · 1.41 KB
/
message_action.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
44
45
46
47
48
49
50
51
52
<!DOCTYPE HTML>
<html>
<meta charset="UTF-8">
<title>经验共享平台</title>
<link rel="bookmark" type="image/x-icon" href="img/+1.ico" />
<link rel="shortcut icon" href="img/+1.ico">
<link rel="icon" href="img/+1.ico">
<link rel="stylesheet" href="style/css/bootstrap.css">
<script src="style/js/jquery.js"></script>
<script src="style/js/bootstrap.js"></script>
<!--notify-->
<link rel="stylesheet" href="style/css/animate.css">
<script src="style/js/bootstrap-notify.js"></script>
<body>
<?php
if(PHP_VERSION >= 6 || !get_magic_quotes_gpc())
{
$_POST = array_map( 'addslashes', $_POST);
}
require_once('config.php');
$author_id = isset($_COOKIE["userid"]) ? $_COOKIE["userid"] : '0';
$name=$_POST["user"];
$email=$_POST["email"];
$comment=$_POST["comment"];
$remote_ip = $_SERVER["REMOTE_ADDR"];
$timenow = date("Y-m-d H:i:s");
$con=mysqli_connect(HOST, USERNAME, PASSWORD);
mysqli_set_charset($con, "utf8");
mysqli_select_db($con, 'experience_base');
$insertsql_add= "INSERT INTO eb_message_board(create_tm, create_ip, name, email, m_author_id, comment)
VALUES('$timenow', '$remote_ip', '$name', '$email', '$author_id', '$comment')";
if(mysqli_query($con, $insertsql_add))
{
echo ("<script>$.notify({message: '留言成功!'}, {type: 'success'});</script>");
header("Refresh: 1; url=message_board.php");
}
else
{
echo mysqli_error($con);
}
mysqli_close($con);
?>
</body>
</html>