<?php session_start() ; $user_login = $_POST['user_login']; $pwd_login = $_POST['pwd_login']; if(isset($user_login) and isset($pwd_login)) { include("Connections/config.inc.php") ; ?> <html> <head> <title>:: ผลการเข้าสู่ระบบ ::</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> </head> <body bgcolor="#FFFFCC"> <?php $result = mysql_query("select user,password from member where user='$user_login' and password='$pwd_login'") ; $num = mysql_num_rows($result) ; if($num<=0) { echo "<br><br><center><font size='3' face='MS Sans Serif'><b>รหัสผ่านไม่ถูกต้องครับ</b></font></center>" ; print "<meta http-equiv=refresh content=3;URL=index.php>"; } else { $dbarr = mysql_fetch_array($result) ; if($user_login!=$dbarr['user'] and $pwd_login!=$dbarr['password']) { echo "รหัสผ่านไม่ถูกต้อง" ; }else { $_SESSION['login_true'] = $user_login; echo "<meta http-equiv='refresh' content='0 ;url=member_detail.php'>" ; } } } ?> </body> </html>
<?php session_start() ; $user_login = $_POST['user_login']; $pwd_login = $_POST['pwd_login']; if(isset($user_login) and isset($pwd_login)) { include("Connections/config.inc.php") ; ?> <html> <head> <title>:: ผลการเข้าสู่ระบบ ::</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> </head> <body bgcolor="#FFFFCC"> <?php $result = mysql_query("select user,password from member where user='$user_login' and password='$pwd_login' and active="Y" ") ; // จะ "Y" หรือ 'Y' นีแหละคับลองดู $num = mysql_num_rows($result) ; if($num<=0) { echo "<br><br><center><font size='3' face='MS Sans Serif'><b>รหัสผ่านไม่ถูกต้องครับ</b></font></center>" ; print "<meta http-equiv=refresh content=3;URL=index.php>"; } else { $dbarr = mysql_fetch_array($result) ; if($user_login!=$dbarr['user'] and $pwd_login!=$dbarr['password']) { echo "รหัสผ่านไม่ถูกต้อง" ; }else { $_SESSION['login_true'] = $user_login; echo "<meta http-equiv='refresh' content='0 ;url=member_detail.php'>" ; } } } ?> </body> </html>
<?php session_start(); if(isset($_POST['Submit'])){ $username=trim($_POST['username']); $password=trim($_POST['password']); $passen=base64_encode(base64_encode(base64_encode($password))); $SQL="SELECT user_id,username,password,isadmin,isactive FROM user WHERE username='$username' and password='$passen' "; $rs=$db->Execute($SQL)or die('ERROR1'); $num=$rs->NumRows(); $result=&$rs->fields; $_SESSION['sess_user_id']=$result['user_id']; $_SESSION['sess_username']=$result['username']; $_SESSION['sess_isadmin']=$result['isadmin']; $_SESSION['sess_isactive']=$result['isactive']; $isactive=$result['isactive']; if($num<>0){ if($isactive=='N'){/*ฟิลด์ active คือกำหนดสถานะการเข้าใช้นะครับ ลองประยุกต์ดูครับ */ echo"<script>alert(\"คุณยังไม่ได้รับอนุญาติเข้าใช้งาน กรุณาติดต่อเจ้าหน้าที่เกี่ยวข้อง\");</script>"; } else{ $SQL1="UPDATE user SET lastlogin=$datenewnow WHERE username='$username' and password='$passen' "; $rs1=$db->Execute($SQL1)or die('ERROR2'); echo"<script>window.location='code/main.php';</script>"; } } else{ echo"<script>alert(\"ชื่อหรือรหัสผ่านไม่ถูกต้อง\");</script>"; } } ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง