Advertisement
Guest User

Untitled

a guest
Mar 6th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <?php
  3. $username = "tal";
  4. $password = "hackeru";
  5. ?>
  6. <html>
  7. <?php
  8. echo "Hello, ".$username;
  9. ?>
  10.  
  11. <form method="POST" >
  12. <input type="text" placeholder="Username..." name="user" />
  13. <input type="text" placeholder="Password..." name="pass" />
  14. <input type="submit" value="Login!" />
  15. </form>
  16.  
  17. <a href="register.html">Register!</a>
  18. <a href="new-post.html">New Post!</a>
  19.  
  20. <?php
  21. if(isset($_POST['user'], $_POST['pass'])) {
  22. if($_POST['user'] == $username && $_POST['pass'] == $password) {
  23. echo "Success!";
  24. } else {
  25. echo "Error!";
  26. }
  27. }
  28. ?>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement