?
Path : /home/admin/public_html/ |
Current File : /home/admin/public_html/save.php |
<? ob_start(); require_once "include/connect.php"; ?> <html> <head> <link rel="stylesheet" type="text/css" href="form.css"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Save Ticket</title> </head> <body> <? $name=$_POST["name"]; $email=$_POST["email"]; $tel=$_POST["tel"]; $addr=$_POST["addr"]; $date=date("Y-m-d h:i:s"); $sql_check = "select * from ticket_nami where name = '".$name."' or email='".$email."'"; $exsit=mysqli_query($connect,$sql_check); if(mysqli_num_rows($exsit)>0) { ?> <div style="text-align:center;padding:10px;">ข้อมูลซ้ำ กรุณากรอกข้อมูลใหม่อีกครั้ง <script type="text/javascript"> setTimeout(function() { window.top.location.href = "http://happytokorea.com/travel-detail.php?id=201611101019386"; }, 1500); </script> </div> <? } else { mysqli_query($connect,"INSERT INTO ticket_nami(name,email,tel,address,date_apply) values('$name','$email','$tel','$addr','$date')") ; ?> <div style="text-align:center;padding:10px;">ลงทะเบียนเรียบร้อย <script type="text/javascript"> setTimeout(function() { window.top.location.href = "http://happytokorea.com/travel-detail.php?id=201611101019386"; }, 1500); </script> </div> <? } ?> </body> </html>