<?php require_once 'lib/configdb.inc'; require_once 'adodb5/adodb.inc.php'; require_once 'adodb5/drivers/adodb-mysql.inc.php'; require_once 'lib/connectdb.inc.php'; $user = $_POST['username']; $pass = $_POST['password']; $rs = $conn->Execute("select * from users where username ='$user' and pass='$pass' "); if($rs->RecordCount()<=0) { $data['success'] = 0; $data['message'] = "You can't access"; } else { $data['success'] = 1; $data['message'] = "You are Admin."; $_SESSION['user'] = $user; $id = $rs->fields["user_id"]; $rs = $conn->Execute("select * from student where user_id='$id'"); if($rs->RecordCount()<=0) { $rs = $conn->Execute("select * from teacher where user_id='$id'"); if($rs->RecordCount()<=0) { $rs = $conn->Execute("select * from admin where user_id='$id'"); if($rs->RecordCount()<=0) { } else { $_SESSION['author'] = "admin"; $_SESSION['name'] = $rs->fields['name']; $_SESSION['surname'] = $rs->fields['surname']; } } else { $_SESSION['author'] = "teacher"; $_SESSION['name'] = $rs->fields['name']; $_SESSION['surname'] = $rs->fields['surname']; } } else { $_SESSION['author'] = "student"; $_SESSION['name'] = $rs->fields['name']; $_SESSION['surname'] = $rs->fields['surname']; } } echo json_encode($data); ?>
<?php session_start(); $user = $_POST['username']; $pass = $_POST['password']; require_once 'lib/configdb.inc'; require_once 'adodb5/adodb.inc.php'; require_once 'adodb5/drivers/adodb-mysql.inc.php'; require_once 'lib/connectdb.inc.php'; $rs = $conn->Execute("select * from users where username ='$user' and pass='$pass' "); if($rs->RecordCount()<=0) { $data['success'] = 0; $data['message'] = "You can't access"; } else { $data['success'] = 1; $data['message'] = "You are Admin."; $_SESSION['user'] = $user; $id = $rs->fields["user_id"]; $rs = $conn->Execute("select * from student where user_id='$id'"); if($rs->RecordCount()<=0) { $rs = $conn->Execute("select * from teacher where user_id='$id'"); if($rs->RecordCount()<=0) { $rs = $conn->Execute("select * from admin where user_id='$id'"); if($rs->RecordCount()<=0) { } else { $_SESSION['author'] = "admin"; $_SESSION['name'] = $rs->fields['name']; $_SESSION['surname'] = $rs->fields['surname']; } } else { $_SESSION['author'] = "teacher"; $_SESSION['name'] = $rs->fields['name']; $_SESSION['surname'] = $rs->fields['surname']; } } else { $_SESSION['author'] = "student"; $_SESSION['name'] = $rs->fields['name']; $_SESSION['surname'] = $rs->fields['surname']; } } echo json_encode($data); ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง