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! Quote Link to comment 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... Quote Link to comment 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... Quote Link to comment 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! 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.