hypgraphix Posted April 19, 2007 Share Posted April 19, 2007 My client wants a splash page for his initial index page and doesn't not want people to be able to go any further into the website with a username and password he will provide for them directly. On that splash page he wants a place for them to login with the username and password he provided. How to I create a database for this? I am total lost! Please help me. I am brand new to this stuff. Thanks so much to anyone who will help me! Link to comment https://forums.phpfreaks.com/topic/47772-please-help-login-in-database-with-client-provided-usernames-and-passwords/ Share on other sites More sharing options...
bsprogs Posted April 19, 2007 Share Posted April 19, 2007 This doesn't seem to be a PHP question. When one of the moderators moves it to "SQL / Database Forums" you'll have better luck. However, if you're new to this, you may want to consult a tutorial on databases http://www.kirupa.com/developer/php/relational_db_design.htm You'll have to do some small requirements gathering based on what the client actually needs from each user that he supplies a username and password so. Example : First Name, Last Name, Birthdate, Address, City, State, Zip, Access Level (limits what a person actually has access to on the site), etc... Link to comment https://forums.phpfreaks.com/topic/47772-please-help-login-in-database-with-client-provided-usernames-and-passwords/#findComment-233348 Share on other sites More sharing options...
mpharo Posted April 19, 2007 Share Posted April 19, 2007 You just need to create a simple form with a username and password field, then pass these 2 fields into a page that you will use to execute your sql query from to compare the username and password submitted to...it will look something like this.... index.php <form name="login" method="post" action="auth.php"> <table border="1"> <tr> <td> Enter Login: </td> <td> <input type="text" name="username"> </td> </tr> <tr> <td> Enter Password: </td> <td> <input type="password" name="pass"> </td> </tr> <tr> <td> </td> <td> <input type="submit" value="Login"> </td> </tr> </table> </form> auth.php $password=md5($_POST[pass]); $select=mysql_query("SELECT * FROM users WHERE username=$_POST[username] AND password=$password") or die(mysql_error()); $sql=mysql_num_rows($select); If ($sql){ echo "Login Sucessfully!"; }Else{ echo "Login Failed!!"; } You just need to have a table called users with a field called username and a password field with md5 encryption... Link to comment https://forums.phpfreaks.com/topic/47772-please-help-login-in-database-with-client-provided-usernames-and-passwords/#findComment-233351 Share on other sites More sharing options...
hypgraphix Posted April 19, 2007 Author Share Posted April 19, 2007 Thanks so much for pointing me in the right direction! Link to comment https://forums.phpfreaks.com/topic/47772-please-help-login-in-database-with-client-provided-usernames-and-passwords/#findComment-233357 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.