<?php session_start(); ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'; $username = $_POST['username']; $password = $_POST['password']; if($username == "") { echo "กรุณากรอก Username"; echo "<meta http-equiv='refresh' content='1;URL=home.php'>"; } else if($password == "") { echo "กรุณากรอก Password"; echo "<meta http-equiv='refresh' content='1;URL=home.php'>"; } else { include("./connect.php"); $query="SELECT * FROM member where username ='$username' and password ='$password';"; $check_log = mysqli_query($conn,$query); $num = mysqli_num_rows($check_log); $num; if($num <=0) { echo "Username หรือ Password ผิดกรุณา Login ใหม่อีกครั้ง <br /><a href='home.php'>Back</a>"; } else { $data = mysqli_fetch_array($check_log); if($data['status']=="admin"){ echo "Hi Welcome Back Admin<br />"; $_SESSION['ses_userid'] = session_id(); $_SESSION['ses_username'] = $username; $_SESSION['ses_status'] = "admin"; echo "<meta http-equiv='refresh' content='1;URL=Admin file/management.php'>"; }elseif($data['status']=="user"){ echo " Welcome <br />"; $_SESSION['ses_userid'] = session_id(); $_SESSION['ses_username'] = $username; $_SESSION['ses_status'] = "user"; echo "<meta http-equiv='refresh' content='1;URL=index_user.php'>"; } } } ?> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง