| Server IP : 27.254.152.13 / Your IP : 216.73.217.38 Web Server : Apache/2 System : Linux ns1-252017.dragonhispeed.com 5.2.0 #1 SMP Fri Mar 29 22:50:14 MSK 2024 x86_64 User : coloflew ( 1072) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/coloflew/domains/tessabalpatiu.go.th/private_html/form/ |
Upload File : |
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
//if (!isset($_POST['name'], $_POST['mobile'], $_POST['title']), $_POST['topic']), $_POST['description']), $_POST['file'])) {
if (!isset($_POST['title'], $_POST['description'], $_POST['name'])) {
header('Location: index.php');
exit;
}
$DATA = $_POST;
foreach ($DATA as $key => $value) {
$DATA[$key] = trim($value);
}
if ($DATA['title'] === '') {
$FORM_ERRORS['title'] = "กรุณาระบุ 'หัวข้อ'";
}
elseif (mb_strlen($DATA['title'], 'UTF-8') > 255) {
$FORM_ERRORS['title'] = "'หัวข้อ' ต้องมีความยาวไม่เกิน 255 ตัวอักษร";
}
if ($DATA['description'] === '') {
$FORM_ERRORS['description'] = "กรุณาระบุ 'รายละเอียด'";
} elseif (mb_strlen($DATA['description'], 'UTF-8') > 65535) {
$FORM_ERRORS['description'] = "'รายละเอียด' ต้องมีความยาวไม่เกิน 65535 ตัวอักษร";
}
if ($DATA['name'] === '') {
$FORM_ERRORS['name'] = "กรุณาระบุ 'ชื่อ'";
} elseif (mb_strlen($DATA['name'], 'UTF-8') > 64) {
$FORM_ERRORS['name'] = "'ชื่อ' ต้องมีความยาวไม่เกิน 64 ตัวอักษร";
}
if (!isset($FORM_ERRORS)) {
require 'inc/mysqli.inc.php';
$mysqli->query(
"
INSERT INTO `form_topic`
(
`last_commented`,
`name`,
`mobile`,
`title`,
`topic`,
`description`,
`file`,
`ip`
)
VALUES
(
NOW(),
'{$mysqli->escape_string($DATA['name'])}',
'{$mysqli->escape_string($DATA['mobile'])}',
'{$mysqli->escape_string($DATA['title'])}',
'{$mysqli->escape_string($DATA['topic'])}',
'{$mysqli->escape_string($DATA['description'])}',
'{$mysqli->escape_string($DATA['file'])}',
'{$_SERVER['REMOTE_ADDR']}'
)
"
);
header('Location: complete.php');
exit;
}
} else {
$DATA = array(
'title' => '',
'description' => '',
'name' => '',
);
}
$TAGS = array('PHP', 'JavaScript', 'SQL', 'HTML', 'CSS');
$TITLE = 'กรอกข้อมูล เพื่อขอใช้บริการ';
$PAGE_TEMPLATE = 'inc/post.inc.php';
require 'inc/main.inc.php';