-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage_add.php
More file actions
52 lines (45 loc) · 1.38 KB
/
message_add.php
File metadata and controls
52 lines (45 loc) · 1.38 KB
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
<?php
if(!isset($_SESSION))
{
session_start();
}
header("Content-Type: text/html; charset=utf-8");
require_once("connMysql.php");
include_once("locaction.php");
date_default_timezone_set('Asia/Taipei');
$day=date("Y-m-d-D");
$time=date("H:i:s");
if(isset($_POST['fb_id'])){
$_SESSION["fb_id"] = $_POST['fb_id'];
}else {
if(isset($_SESSION["fb_id"])){
$_SESSION["fb_id"] = $_SESSION["fb_id"];
}
else {
$_SESSION["fb_id"] = "0";
}
}
$sql = "INSERT INTO `message` (`fb_id`, `impression`, `green_action`, `time`, `day`) VALUES (";
$sql .= "'".$_SESSION["fb_id"]."',";
$sql .= "'".$_POST['impression']."',";
$sql .= "'".$_POST['green_action']."',";
$sql .= "'".$time."',";
$sql .= "'".$day."')";
mysql_query($sql);
$impression = $_POST['impression'];
$green_action = $_POST['green_action'];
#header("Location: message_show.php");
?>
<!DOCTYPE html>
<html>
<head>
<title>綠色行動</title>
</head>
<body>
<form id="form1" method="post" action="message_show_me.php">
<input type="hidden" name="impression" value="<?php echo "$impression"; ?>" id="impression">
<input type="hidden" name="green_action" value="<?php echo "$green_action"; ?>" id="green_action">
</form>
</body>
</html>
<?php echo "<script>form1.submit();</script>"; ?>