0byt3m1n1-V2
Path:
/
home
/
bangtoey
/
domains
/
bangtoey.go.th
/
public_html
/
poll
/
[
Home
]
File: poll_save.php
<?php session_start(); if($_SESSION["user"]==""){ session_destroy(); $message = "กรุณา Login ก่อน."; $url = "../admin/index.php"; include("../admin/alert.php"); exit; } require_once('../admin/Connections/conndb.php'); mysql_select_db($database_conndb, $conndb); header('Content-Type: text/html; charset=windows-874'); $title=trim($_POST[title]); if($title!=""){ $now=date("Y-m-d H:i:s"); $sql="INSERT INTO poll (p_title,created,updated) VALUES ('".mysql_real_escape_string($title)."','".$now."','".$now."')"; mysql_query($sql) or die(mysql_error()); $getp="SELECT id_poll FROM poll WHERE updated='".$now."'"; $resp=mysql_query($getp) or die(mysql_error()); $datp=mysql_fetch_array($resp); header("Location: add_choice.php?idp=".$datp[id_poll]); } else{ ?> <script> alert('กรุณาใส่คำถามของแบบสอบถาม'); history.back(-1); </script> <?php } ?>
©
2018.