Guest User

Untitled

a guest
Oct 29th, 2017
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. class login {
  3.  
  4. private $user = "user";
  5. private $pass = "pass";
  6.  
  7. function checkLogin() {
  8.  
  9. if($this->user == $_POST['email'] && $this->pass == $_POST['password'])
  10. {
  11. echo"success!";
  12. } else {
  13. echo"Invalid email or password.";
  14. }
  15.  
  16.  
  17.  
  18.  
  19.  
  20. }
  21.  
  22. }
  23. if(isset($_POST['submit']))
  24. {
  25. $login = new login();
  26. $login->checkLogin();
  27. }
  28.  
  29.  
  30. ?>
  31. <form action="" method="POST">
  32.  
  33. <input type="text" name="email"/>
  34. <br/>
  35. <input type="password" name="password" />
  36. <br/>
  37. <input type="submit" name="submit" value="Log In" />
  38.  
  39. </form>
Add Comment
Please, Sign In to add comment