Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4. <title>DaBrix Design Idea 2</title>
  5. <link rel="stylesheet" type="text/css" href="index.css" />
  6. </head>
  7. <body>
  8.  
  9. <?php
  10. $username = $_POST['username'];
  11. $password = $_POST['password'];
  12. $email = $_POST['email'];
  13.  
  14. $form = "<div class='login'>
  15. <form method='post' action='index.php'>
  16. Username: <input type='text' name='username' /><br />
  17. Password: <input type='password' name='password' /><br />
  18. <input type='submit' value='Login' /> |
  19. </form>";
  20.  
  21. mysql_connect('localhost', 'dasher93_dash', 'xd10ah');
  22. mysql_select_db("dasher93_dabrix");
  23.  
  24. mysql_query("SELECT * FROM users WHERE username = $username && password = $password");
  25.  
  26. if (isset($_POST['username']) && isset($_POST['password']) )
  27. {
  28.  
  29.  
  30. if ($_POST['username'] = $username && $_POST['password'] = $password)
  31. {
  32. echo "You are logged in";
  33. }
  34. else
  35. {
  36. echo $form;
  37. echo "Wrong password</div>";
  38. }
  39. }
  40.  
  41.  
  42. else
  43. {
  44. echo $form;
  45. echo "<font size='1'><a href='createaccount.php'>Create an account</a></font></div>";
  46. }
  47.  
  48. // Need to do the DB stuff: SELECT * FROM users WHERE username = $username && password = $password
  49. // Need to contact Ace_Jon
  50.  
  51. ?>
  52.  
  53. </body>
  54. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement