<form id="form1" name="form1" method="post" action="programchk.php"> <table width="450" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#E2E2C7"> <tr bgcolor="#EDEDDC"> <th colspan="2" scope="row">MEMBER</th> </tr> <tr> <th width="105" scope="row">username</th> <td width="336"><input type="text" name="username" id="username" /></td> </tr> <tr> <th scope="row">Password</th> <td><input type="password" name="password" id="password" /></td> </tr> <tr bgcolor="#EDEDDC"> <th colspan="2" scope="row"><input type="submit" name="button" id="button" value="Submit" /></th> </tr> </table> </form>
session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?PHP include("connection/connect.php"); include("connection/function.php"); include("useronline.php"); $username = $_POST['username']; $user_passpro = md5($_POST['password']); if(empty($username)||empty($user_passpro)) { echo "<script>alert('กรอกข้อมูลไม่ครบคร๊าบ');history.back();</script>"; exit(); } $sql = "select * from phpbb_users where username='$username' and user_passpro='$user_passpro' and statscorecard='9'"; $query = mysql_query($sql) or die("error=$sql"); $num = mysql_num_rows($query); $row = mysql_fetch_array($query); //echo $row[tblogin]; if($num==0) { echo "<script>alert('## Login Fail ##');history.back();</script>"; exit(); } for ($i=0;$i<count($f);$i++) { if ($f[$i]>$nu) { $sql = "update phpbb_users set tblogin = 7"; $query = mysql_query($sql) or die("error=$sql"); } } if($row[tblogin] == 9) {echo "<script>alert('@@ log in ซ้ำ @@');history.back();</script>"; exit(); } else { $_SESSION['username']=$username; echo "<script>alert('@@ Welcome @@');window.location='data.php';</script>"; exit(); }
$time=time(); $nu=time()-60; # ประมาณ 1 นาที ที่แล้ว $file="useronline2.txt"; #ชื่อไฟล์ที่ต้องการเก็บ $f=fopen($file,"a+"); fputs($f,$time."\n"); # จัดเก็บเวลาปัจจุบัน ลง file fclose($f); $count_users = count(file($file)); # นับจำนวนบรรทัด $f=file($file); $f1=fopen($file,"w"); for ($i=0;$i<count($f);$i++) { if ($f[$i]>$nu) { fputs($f1,$f[$i]); } # ถ้าค่า time ที่เก็บไว้มากกว่า ค่า $nu ให้ลบออก } fclose($f1);
session_start(); include("connection/function.php"); include("connection/connect.php"); @chklogin($_SESSION['username']); //$_SESSION['username']=$username; include("useronline.php"); $sql = "select * from phpbb_users where username='$username'"; $query = mysql_query($sql) or die("error=$sql"); $row = mysql_fetch_array($query); //print_r($row); $sql = "update phpbb_users set tblogin = 9, logintime='$time' where username='$username' "; $query = mysql_query($sql) or die("error=$sql");
function chklogin($username) { if(!isset($username)) { echo "<script>alert(' Please Login ');window.location='program.php';</script>"; exit(); } }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง