Advertisement
Guest User

Untitled

a guest
Jul 31st, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Login Page</title>
  5. </head>
  6. <body>
  7.  
  8. <form method="post" action="login.php">
  9. <table width="400" border="5" align="center">
  10. <tr>
  11. <td colspan="5" align="center"><h1>Login Form</h1></td>
  12. </tr>
  13.  
  14. <tr>
  15. <td align="center">Email Address</td>
  16. <td><input type="email" name="email" placeholder="john.smith@email.com" /></td>
  17. </tr>
  18.  
  19. <tr>
  20. <td align="center">Password</td>
  21. <td><input type="password" name="pass" placeholder="**********" /></td>
  22. </tr>
  23.  
  24. <tr>
  25. <td colspan="5" align="center"><input type="submit" name="login" value="Login" /></td>
  26. </tr>
  27.  
  28. </table>
  29. </form>
  30. <br>
  31. <center><strong>Not Registered Yet?</strong><br><a href="registration.php">Register Here<a></center>
  32. </body>
  33. </html>
  34.  
  35. <?php
  36.  
  37. ### CONNECT TO MYSQL DATABASE ###
  38. mysql_connect("localhost","root","") or die("Your Suck!");
  39. mysql_select_db("curispark");
  40.  
  41. if(isset($_POST['login'])) {
  42.  
  43. $password = $_POST['pass'];
  44. $email = $_POST['email'];
  45.  
  46. $check_user = "select * users where user_pass='$password' AND user_email='$email'";
  47.  
  48. $run = mysql_query($check_user);
  49.  
  50. if(mysql_num_rows($run) > 0) {
  51. echo "<script>window.open('welcome.php','_self')</script>";
  52. }
  53. else {
  54. echo "<script>alert('Email or password is incorrect!')</script>";
  55. }
  56. }
  57.  
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement