i have html registration form username , password inputs. usernames , passwords stored in .txt
file this:
username1,password1 username2,password2
i need match entered username , password stored ones. code, not working, can advise?
<form action = "./get_form.php" method = "post" name = "form" > username: <input type= "text" name = "username" > password: <input type= "text" name = "passwords" > remember me: <input type= "checkbox" name = "remember" value = "checked" > <input type = "submit" name = "submit" value= "submit query" > </form> <?php $username= $_post["username"]; $password= $_post["password"]; $contents = file("passwords.txt"); $found = false; foreach ($contents $line) { $data = explode(',', $line); if (($username === $data[0]) && ($password === $data[1])) { $found = true; } } ?>
Comments
Post a Comment