tarun Posted April 10, 2007 Share Posted April 10, 2007 users.txt user1|||pass1 user2|||pass2 user3|||pass3 login.php <?php $user = $_POST["u"]; $pass = $_POST["p"]; $db = file("users.txt"); foreach($db as $key => $val) { $data[$key] = explode("|||", $val); } for($k = 0; $k < sizeof($db); $k++) { $u = $data[$k][0]; $p = $data[$k][1]; if ( $u == "$user" ) { if ( $p == "$pass" ) { echo 'You Are Now Logged In As: '.$u.''; } else { echo 'Username And Password Do Not Match'; } } } ?> The If Statement Doesn't Work I Get The Error: "Username And Password Do Not Match" Even If The Username And Password Are Actually Right AnyHelp? Thnx, Tarun Quote Link to comment Share on other sites More sharing options...
tarun Posted April 10, 2007 Author Share Posted April 10, 2007 Sorry Made An Unnesscary Topic Ive Been Helped With This Before Please Forgive Me Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.