alin19 Posted February 6, 2008 Share Posted February 6, 2008 i have this login for: it's from the net <html> <head> <title>Log-In</title> <style> h1{font:12pt arial} h2{font:11pt arial} </style> </head> <body> <br> <center> <h2>Webmasters feel free to change this log in form/page to suit your needs</h2> <br> <br> <br> <h1>Log in to my secret page... <br> <br> Example usernames and passwords are:<br> <br> <b> name1 and pass1<br> name2 and pass2<br> name3 and pass3<br> </b> </h1> <br> <form method="post" action="dataProcess.php"> <p style="font:11pt arial">Enter Name: <input type="text" name="loginName"> <p style="font:11pt arial">Enter Pass: <input type="password" name="passWord"> <p><input type="submit" name="submit" value="Log In"> </form> </body> </html> and this secure page: <?php // Secure multiple user Log-In script by Dave Lauderdale - Originally published at: www.digi-dl.com $filename = "user.log"; $log = fopen($filename, "r"); $contents = fread($log, filesize($filename)); fclose($log); // Add usernames below if ($contents == "name1" || $contents == "name2" || $contents == "name3") { $filename = "user.log"; $log = fopen($filename, "w+"); fputs($log,""); fclose($log); here i have a php script } else { echo "<center><Br><font color=red face=arial size=3 >Error</font>...<font face=arial size=3 >You will have to log on via the log on form to view this page.<br><br><a href='login.html' style='color:black'>Click here</a> to try again."; } ?> i login, i view the page but when i press a submit button i recive the message that i'm not log in; and this error Warning: fread(): Length parameter must be greater than 0. in c:\program files\easyphp1-8\www\ext\secure.php on line 7 Quote Link to comment https://forums.phpfreaks.com/topic/89683-solved-login-form/ Share on other sites More sharing options...
pdkv2 Posted February 6, 2008 Share Posted February 6, 2008 Check the file size of "user.log" is it greater than 0 byte ??? Quote Link to comment https://forums.phpfreaks.com/topic/89683-solved-login-form/#findComment-459580 Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 Put your code in [code ] tags. Quote Link to comment https://forums.phpfreaks.com/topic/89683-solved-login-form/#findComment-459634 Share on other sites More sharing options...
alin19 Posted February 6, 2008 Author Share Posted February 6, 2008 i've found another login form, is more easy to use and better i think Quote Link to comment https://forums.phpfreaks.com/topic/89683-solved-login-form/#findComment-459665 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.