-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsavecomment.php
More file actions
41 lines (34 loc) · 996 Bytes
/
savecomment.php
File metadata and controls
41 lines (34 loc) · 996 Bytes
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
<?php
header("Content-type: text/html; charset=utf-8");
session_start();
require_once "service/service.php";
if($_SESSION[MEMBER]['LOGIN'] != 'ON'){
@header('location: /index.php');
exit;
}
if ($_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'])) {
$sql="
INSERT INTO comment (
memberID,
matchID,
msg,
ip,
user_create,
date_create
)
VALUES(
'".$_SESSION[MEMBER]['DATA']['code']."',
'".$_POST['matchID']."',
'".$_POST['msg']."',
'".get_client_ip()."',
'".$_SESSION[MEMBER]['DATA']['username']."',
NOW()
)
";
$query=mysql_query($sql) or die(mysql_error());
echo '<script language="javascript">window.location.replace("comment.php?matchID='.$_POST['matchID'].'");</script>';
}else{
echo '<script language="javascript">alert("กรุณาตรวจสอบ CODE 4 หลัก ");</script>';
echo '<script language="javascript">window.location.replace("addComment.php?matchID='.$_POST['matchID'].'");</script>';
}
?>