Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>DaBrix Design Idea 2</title>
- <link rel="stylesheet" type="text/css" href="index.css" />
- </head>
- <body>
- <?php
- $form = "<div class='login'>
- <form method='post' action='index.php'>
- Username: <input type='text' name='username' /><br />
- Password: <input type='password' name='password' /><br />
- <input type='submit' value='Login' /> |
- </form>";
- mysql_connect('localhost', 'dasher93_dash', 'xd10ah');
- mysql_select_db("dasher93_dabrix");
- if (isset($_POST['username']) && isset($_POST['password']) )
- {
- // This is still unsecure:
- $username = $_POST['username'];
- $password = $_POST['password'];
- $email = $_POST['email'];
- $user = mysql_query("SELECT * FROM users WHERE username = '$username' AND password = '$password'");
- if (mysql_num_rows($user) == 1)
- {
- echo "You are logged in";
- }
- else
- {
- echo $form;
- echo "Wrong password</div>";
- }
- }
- else
- {
- echo $form;
- echo "<font size='1'><a href='createaccount.php'>Create an account</a></font></div>";
- }
- // Need to do the DB stuff: SELECT * FROM users WHERE username = $username && password = $password
- // Need to contact Ace_Jon
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement