<? session_start(); ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <? $userlogin=$_GET[userlogin]; $pwlogin=$_GET[pwlogin]; include "connect.php"; if($userlogin=='boss'&& $pwlogin=='boss'){ echo "<meta http-equiv='Content-Type' content='text/html; charset=windows-874'>"; echo "<meta http-equiv='refresh' content='1;url=Boss/home.php'>"; echo "<center><h3>::Login ถูกต้อง::</h><br><h3>ยินดีต้อนรับ $Name</h><br><br /> <img src='image/wait1.gif' width='200' height='30'><br><br /> <h3>::กรุณารอสักครู่::</h></center>";} else if($userlogin=="" ||$pwlogin=="") { echo "<center><h3>::กรุณากรอกข้อมูลให้ครบ::</h><br><img src='image/wait1.gif' width='200' height='30'><br>"; echo"<meta http-equiv='refresh' content='1;url=home.php'>"; } else{ $sqlcomm="select * from employee where Username ='$userlogin' AND Password ='$pwlogin'"; $result=mysql_db_query($mydb,$sqlcomm); $rs=mysql_fetch_array($result); $Employee_id=$rs[Employee_id]; $Name=$rs[Name]; $Position=$rs[Position]; $Username=$rs[Username]; if($Position=='') { echo "<center><h3>::Login ไม่ถูกต้อง::</h><br><img src='image/wait1.gif' width='200' height='30'><br><h3>::กรุณากรอกข้อมูลใหม่::</h></center>"; echo"<meta http-equiv='refresh' content='1;url=home.php'>"; } else { echo "<center><h3>::Login ถูกต้อง::</h><br><h3>ยินดีต้อนรับ $Name</h><br><br /> <img src='image/wait1.gif' width='200' height='30'><br><br /> <h3>::กรุณารอสักครู่::</h></center>"; if($Position=='ฝ่ายการขาย'){ $_SESSION[sess_id]=session_id();$_SESSION[sess_userlogin]=$userlogin; echo"<meta http-equiv='refresh' content='1;url=Seller/home.php'>"; } else if($Position=='ฝ่ายบุคคล'){ $_SESSION[sess_id]=session_id();$_SESSION[sess_userlogin]=$userlogin; echo"<meta http-equiv='refresh' content='1;url=HumanResource/home.php'>"; } //?Employee_id=$Employee_id else if($Position=='STOCK'){ $_SESSION[sess_id]=session_id();$_SESSION[sess_userlogin]=$userlogin; echo"<meta http-equiv='refresh' content='1;url=Stocker/home.php'>"; }//?Employee_id=$Employee_id else if($Position=='ฝ่ายบัญชี'){ $_SESSION[sess_id]=session_id();$_SESSION[sess_userlogin]=$userlogin; echo"<meta http-equiv='refresh' content='1;url=Accounting/home.php'>"; } else if($Position=='พนักงานล้างรถ'){ $_SESSION[sess_id]=session_id();$_SESSION[sess_userlogin]=$userlogin; echo"<meta http-equiv='refresh' content='1;url=Washing/home.php'>"; } //else if($Position=='ผู้จัดการร้าน'){echo"<meta http-equiv='refresh' content='1;url=Boss/home.php'>"; } else { echo "<center><h3>::ไม่มีตำแหน่งของท่านในระบบ::</h></center>"; echo"<meta http-equiv='refresh' content='1;url=home.php'>"; } } } mysql_close(); ?>
<? session_start(); $_SESSION[sess_userlogin]=$sess_userlogin; if($sess_userlogin=="") { echo "<meta http-equiv='Content-Type' content='text/html; charset=windows-874'>"; echo "<BR><BR><center>กรุณาทำการ Login ก่อน<BR><BR> <img src='image/wait1.gif' width='200' height='30'> <BR><BR>กรุณารอสักครู่</center> <meta http-equiv='refresh' content='1;url=http://localhost/webproject/home.php'>"; exit(); } ?>
Quote:session_cache_expire(30); // เซสชั่นมีอายุ 30 นาที session_start();
Quote:ini_set("session.cookie_lifetime","3600"); // 1 ชั่วโมง
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง