/home/banprang/domains/plai.go.th/public_html/coremain/module/gbook/commit.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
if ($_SESSION['dbname'] == "nversion_77") {
  
$navig['blog'] = "$web_gbook[0]";
  
$navig['blog'] = "ช่องทางแสดงความคิดเห็น";
  
navigator($navig);
  echo 
"<br>";
  
bar_header("ช่องทางแสดงความคิดเห็น"); // Bar_Header
  
fieldset_top("ช่องทางแสดงความคิดเห็น");
} else {
  
$navig['blog'] = "$web_gbook[0]";
  
$navig['blog'] = "สมุดเยี่ยมชม";
  
navigator($navig);
  echo 
"<br>";
  
bar_header("สมุดเยี่ยมชม"); // Bar_Header
  
fieldset_top("สมุดเยี่ยมชม");
}

import_request_variables('pG''p_');
if(
$p_evar!="")                                        {         $Message=trim($p_evar);                }
if(
$p_text!="")                                        {         $text=trim($p_text);                    }
if(
$p_Name!="")                                        {         $Name=trim($p_Name);                    }
if(
$p_Email!="")                                    {         $Email=trim($p_Email);                    }
$IP getenv("REMOTE_ADDR");
$time_today date("H:i:s");
if(
$p_from_pic!="")                                    {        $from_pic=trim($p_from_pic);            }
if(isset(
$p_from_pic)) $from_pic=trim($p_from_pic);
// is the one accessing this page logged in or not?

if (!isset($p_from_pic))
  
$from_pic "";
if (
$_SESSION['try2login'] != md5($from_pic)) {
//  if (session_is_registered('try2login')) {
//    session_unregister('try2login');
//  }
  
if(isset($_SESSION['try2login'])){
    unset(
$_SESSION['try2login']);
  }
  echo
"<center><br>ป้อนรหัสลับไม่ถูกต้องกรุณาป้อนใหม่อีกครั้ง<br>ก่อนป้อนใหม่ให้กดปุ่ม F5 เพื่อสร้างรหัสลับใหม่<br><br>";
  echo
"<a href='javascript:history.back()'><font color='ff0000'>[ป้อนรหัสลับใหม่]</font></center></a><br>";
//  include('coremain/footer.php');
}
//if (session_is_registered('try2login')) {
//  session_unregister('try2login');
//}
if(isset($_SESSION['try2login'])){
  unset(
$_SESSION['try2login']);
}

global 
$Date;

function 
thai_date() {
  
$thaiday = array("อาทิตย์""จันทร์""อังคาร""พุธ""พฤหัสบดี""ศุกร์""เสาร์");
  
$thaimonth = array("ม.ค.""ก.พ.""มี.ค.""เม.ย.""พ.ค.""มิ.ย.""ก.ค.""ส.ค.""ก.ย.""ต.ค.""พ.ย.""ธ.ค.");
  
$Date $thaiday[date("w")] . " " date("j") . " " $thaimonth[date("m") - 1] . " ";
  
$Ythai date("Y") + 543;
  
$Date .= $Ythai;
  return 
$Date;
}

$Date thai_date();
$IP $REMOTE_ADDR;


// หาค่า id สูงสุด + 1
$sqlmax1 "select max(No+1) from cms_gbook";
$resultmax1 mysql_query($sqlmax1);
$datamax1 mysql_fetch_row($resultmax1);
if (
$datamax1[0] == "") {
  
$datamax1[0] = "1";
}

$ex1 explode("http://"$Message);
$ex2 explode("Hi"$Message);

if (
$ex1[1] != "" || $ex2[1] != "" || $Message == "") {
  echo 
"<center><br><br><font color='ff0000'>ล่อแหลมต่อระบบ ไม่อนุญาตให้ลงนาม</font><br><br></center>";
  exit;
} else {
  
$sql_add "INSERT INTO cms_gbook (No, Message, Name, Email, IP, URL, Date) VALUES ('$datamax1[0]', '$Message', '$Name', '$Email', '$IP', '$time_today', '$Date')";
  
$result mysql_query($sql_add) or die("Errror");
}
echo 
"<br><br><center>ข้อมูลได้ถูกบันทึกแล้ว<br><br><br></center>";

echo 
"<meta http-equiv='refresh' content='2; url=index.php?mod=gbook&path=gbook'>";
fieldset_down();
?>