eagleeye678 Posted March 9, 2008 Share Posted March 9, 2008 Hi, I'm new here, just started PHP need some help working on a login page. I have a password file with username:09mklksdf0 There is two boxes one for login and password with a login button, how do i set the two boxes to search the file to see if the login and password is there. This is what i have. <title>My Site with Authentication</title> Today is <?php echo date("m/d/Y"); ?> <form method= "post" action="/testsite/index.php"> Login: <input type = "text" name="login"> <p>Password: <input type = "password" name="password"></p> <p> <input type = "submit" value="Login"> <br> <br> <?php if (file_exists("password")) { echo "File is Found, "; } else { echo "File Not Found, "; } if (is_readable("password")) { echo "File is Readable"; } else { echo "File can not be read"; } ?> <br> <p> File contents is:</p> <?php $aname=$_POST["login"]; $apass=$_POST["password"]; $crypt= crypt($apass,CRYPT_STD_DES); $crypted = $aname. ":" .$crypt; $fp = fopen("password", 'r') or die ("Could not open file, sorry"); while (!feof($fp)) { $line = fgets($fp, 1024); echo $line."<br/>"; } fclose($fp); ?> Thanks Much, Quote Link to comment Share on other sites More sharing options...
eagleeye678 Posted March 9, 2008 Author Share Posted March 9, 2008 Ok, so I've searched and searched and can't find anything. So i have to Bump Thanks Quote Link to comment Share on other sites More sharing options...
eagleeye678 Posted March 9, 2008 Author Share Posted March 9, 2008 Sorry to Bump again, but this thing is breaking my brain. Quote Link to comment Share on other sites More sharing options...
eagleeye678 Posted March 10, 2008 Author Share Posted March 10, 2008 Nobody have any Input? Quote Link to comment Share on other sites More sharing options...
eagleeye678 Posted March 11, 2008 Author Share Posted March 11, 2008 Bump 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.