forked from xr2439/test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddrainlendar.php
More file actions
20 lines (19 loc) · 812 Bytes
/
addrainlendar.php
File metadata and controls
20 lines (19 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
require_once("include.inc.php");
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$result = $database->query("SELECT * FROM user WHERE username='" . addslashes($_SESSION["username"]) . "'");
$row = $result->fetch_array();
$id = $row['id'];
if (strlen($_POST["date"]) && strlen($_POST["event"]))
$database->query("INSERT INTO `rainlendar` (`owner`, `date`, `event`) VALUES ('" . $id. "', '" . $_POST["date"] . "', '" . $_POST["event"] . "')");
else
echo "WRONG_INFO";
exit(0);
}
?>
<form>
<div class="input-group"><span class="input-group-addon" >日期 </span><input class="form-control" name="date" type="date">
</div>
<div class="input-group"><span class="input-group-addon">新事件 </span><input class="form-control" name="event" type="text">
</div>
</form>