<?php header('Content-Type: text/html; charset=utf-8'); session_start(); //เริ่มต้นเซสชั่น $n = $_POST["name"]; //เก็บชื่อที่ส่งมาจากบราวเซอร์ไว้ในตัวแปร $n $p = $_POST["pass"]; //เก็บรหัสผ่านที่ส่งมาจากบราวเซอร์ไว้ในตัวแปร $p $p2=MD5("$p"); include('../config.php'); $sql="SELECT * FROM member WHERE name='$n' AND pass='$p2'"; $query=mysql_query($sql); $numrow=mysql_num_rows($query); if($numrow==1){ $_SESSION["username"]=$n; sendResponse("success", "index.php"); } else { sendResponse("error", "ชื่อหรือรหัสผ่านไม่ถูกต้อง!"); } function sendResponse($status, $message) { echo $status . "|" . $message; } echo $_SESSION["username"]; ?>
<table border="0" class="table_login" cellspacing="10"> <form id="loginForm" method="post" action="chack_login.php"> <tr> <td colspan="2"><!-- กรอบแสดงสถานะ --><div id="promptDiv"></div></td> </tr> <tr> <td>Username</td> <td><input type="text" class="fieldEntry" name="name" id="name"></td> </tr> <tr> <td>Password</td> <td><input type="password" class="fieldEntry" name="pass" id="pass"></td> </tr> <tr> <td colspan="2"><input type="submit" name="sss" value="OK" /></td> </tr> </form> </table>
<?php session_start(); //เริ่มต้นเซสชั่น header('Content-Type: text/html; charset=utf-8'); $n = $_POST["name"]; //เก็บชื่อที่ส่งมาจากบราวเซอร์ไว้ในตัวแปร $n $p = $_POST["pass"]; //เก็บรหัสผ่านที่ส่งมาจากบราวเซอร์ไว้ในตัวแปร $p $p2=MD5("$p"); include('../config.php'); $sql="SELECT * FROM member WHERE name='$n' AND pass='$p2'"; $query=mysql_query($sql); $numrow=mysql_num_rows($query); if($numrow==1){ $_SESSION["username"]=$n; sendResponse("success", "index.php"); } else { sendResponse("error", "ชื่อหรือรหัสผ่านไม่ถูกต้อง!"); } function sendResponse($status, $message) { echo $status . "|" . $message; } echo $_SESSION["username"]; ?>
<?php session_start(); header('Content-Type: text/html; charset=utf-8'); echo $_SESSION["username"]; if (isset($_SESSION["username"])){ echo "ยินดีต้อนรับ!<br />"; }else{ echo "SESSION ยังไม่ถูกเซ็ท!<br />"; } ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง