<html> <title>Login</title> <head> </head> <body> <form id="form1" name="form1" method="post" action="IOfile_strpos.php"> Please Login To Order <br /> User Name : <input type="text" name="userName" id="userName" size=40 /> <br /> Password : <input type="text" name="passWord" id="passWord" size=40 /> <br /> <button type="submit" value="Log In">Log In</button> </form> </body> code หน้าตรวจสอบการlog in ครับ(IOfile_strpos.php) <?php function functionStrpos(){ $file = "Account.txt"; $fileOpen = fopen($file, "r"); while (!feof($fileOpen)){ $userName = fgets($fileOpen, 4096); $checkUser = substr($userName,0 , strpos ($userName, ':')); $checkPass = substr($userName, strpos($userName, ':')+1); if(trim($_POST['userName']) == trim($checkUser) && trim($_POST['passWord']) == trim($checkPass)) { $true = "correct"; } } fclose($fileOpen); if($true == "correct"){ echo "MACTH - user/pass correct"; echo "User Name: ".$_POST['userName']."<br />"; echo "PASSWORD: ".$_POST['passWord']."<br />"; }else{ echo "Invalid User ACCOUNT - user/pass doesn't matched <br />"; echo "Please, Try again !!!!"; } } echo functionStrpos(); ?> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง