<?php $username = $_POST['username']; $password = $_POST['password']; if ($username&&$password) { $connect = mysql_connect('localhost','root','1234') or die('Could not connect '); mysql_select_db('phplogin')or die ('Could not find db'); $query = mysql_query ("SELECT * FROM users WHERE username='$username' "); $numrows = mysql_num_rows($query); if ($numrows!=0) { while ($row = mysql_fetch_assoc($query)) { $dbusername = $row ['username']; $dbpassword = $row ['password']; } //check to see if they match! if ($username==$dbusername&&md5($password)==$dbpassword) { echo "welcome to website! <a href='home.php'> Click </a> here to enter the member page "; $_SESSION['username']=$dbusername; $_SESSION['sess_userid'] = session_id() ; } else echo "<script>alert('password ไม่ถูกต้อง!!');</script>"; } else die("<h3>ไม่มี username นี้ในระบบ <a href=index.html >Back </a></h3>"); } else die ('<h3>กรุณาใส่ username และ password! <a href=index.html >Back </a></h3>'); ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง