<? ***********************รับค่า SESSION **************************************** session_start(); ***********************รับค่า SESSION **************************************** include("../connect.php"); $username = $_POST['username']; $password = $_POST['password']; if(empty($username)) { echo"<script>alert('Please enter your username'); history.back();</script>"; exit(); } if(empty($password)) { echo"<script>alert('Please enter your Password'); history.back();</script>"; exit(); } $sql ="select * from xxxxxxxxxxxxxx where username = '$username' and password = '$password' "; $dbquery = mysql_db_query($dbname,$sql ); $num_row = mysql_num_rows($dbquery ); $num_fields = mysql_num_fields($dbquery ); if($num_row > 0) { ***********************ประกาศ SESSION **************************************** $row = mysql_fetch_array ($dbquery); $_SESSION['username'] =$row['username']; ***********************ประกาศ SESSION **************************************** echo"<script>alert('welcome to Management system'); window.location='manage_main.php';</script>"; exit(); }else{ echo"<script>alert('Username และ Password ไม่ถูกต้อง'); history.back();</script>"; exit(); } ?>
<? ini_set('session.gc_maxlifetime', 3600); // นี่ครับ ***********************รับค่า SESSION **************************************** session_start(); ***********************รับค่า SESSION **************************************** include("../connect.php"); $username = $_POST['username']; $password = $_POST['password']; if(empty($username)) { echo"<script>alert('Please enter your username'); history.back();</script>"; exit(); } if(empty($password)) { echo"<script>alert('Please enter your Password'); history.back();</script>"; exit(); } $sql ="select * from xxxxxxxxxxxxxx where username = '$username' and password = '$password' "; $dbquery = mysql_db_query($dbname,$sql ); $num_row = mysql_num_rows($dbquery ); $num_fields = mysql_num_fields($dbquery ); if($num_row > 0) { ***********************ประกาศ SESSION **************************************** $row = mysql_fetch_array ($dbquery); $_SESSION['username'] =$row['username']; ***********************ประกาศ SESSION **************************************** echo"<script>alert('welcome to Management system'); window.location='manage_main.php';</script>"; exit(); }else{ echo"<script>alert('Username และ Password ไม่ถูกต้อง'); history.back();</script>"; exit(); } ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง