<?php session_start(); // Check If session available if (isset($_SESSION['userName']) && isset($_SESSION['password'])) { $UserName = $_SESSION['userName']; $Password = $_SESSION['password']; $Dir = "Booking/"; if (!file_exists($Dir)) //Check if file not exists. mkdir($Dir, 0777); //Create books directory. $BookFolder = $Dir . $FirstName . ".txt"; $Booking = fopen($BookFolder, "a+"); chmod ($Dir . $FirstName . ".txt", 0777); $FirstName = $_POST['fname']; $LastName = $_POST['lname']; $DateBook = $_POST['datebook']; $Time = $_POST['time']; $GuestNum = $_POST['guest_num']; if (is_writable($BookFolder)) { if (fwrite($Booking, $DateBook . "\n" . $FirstName . "\n" . $LastName . "\n" . $Time . "\n" . $GuestNum . "\n")) { echo "<p>Booking Completed. Thank you for choosing Taley Restaurant.<br/> <form action='menu.html'method='post'> <input type ='hidden' name ='userName' value ='$UserName'/> <input type ='hidden' name ='password' value ='$Password'/> <input type ='hidden' name ='PHPSESSID' value ='<?php echo session_id() ?>'/> <input type='submit' value='Menus page'/></form></p>"; fclose($Booking); } else echo "<p>cannot write record to file.</p>"; } } else { echo "you have to <br/><a href='cust_login.html'>Log in</a>"; } ?>
<?php <?php session_start(); // Check If session available if (isset($_SESSION['userName']) && isset($_SESSION['password'])) { $UserName = $_SESSION['userName']; $Password = $_SESSION['password']; $FirstName = $_POST['fname']; $LastName = $_POST['lname']; $DateBook = $_POST['datebook']; $Time = $_POST['time']; $GuestNum = $_POST['guest_num']; $Dir = "Booking/"; if (!file_exists($Dir)) //Check if file not exists. mkdir($Dir, 0777); //Create books directory. $BookFolder = $Dir . $FirstName . ".txt"; $Booking = fopen($BookFolder, "a+"); chmod ($Dir . $FirstName . ".txt", 0777); if (is_writable($BookFolder)) { if (fwrite($Booking, $DateBook . "\n" . $FirstName . "\n" . $LastName . "\n" . $Time . "\n" . $GuestNum . "\n")) { echo "<p>Booking Completed. Thank you for choosing Taley Restaurant.<br/> <form action='menu.html'method='post'> <input type ='hidden' name ='userName' value ='$UserName'/> <input type ='hidden' name ='password' value ='$Password'/> <input type ='hidden' name ='PHPSESSID' value ='<?php echo session_id() ?>'/> <input type='submit' value='Menus page'/></form></p>"; fclose($Booking); } else echo "<p>cannot write record to file.</p>"; } } else { echo "you have to <br/><a href='cust_login.html'>Log in</a>"; } ?> ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง