Advertisement
Guest User

index.php

a guest
Mar 8th, 2019
398
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 = "Reuven";
  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 herf="register.html">Register!</a>
  18. <a herf="new-post.html">New Post!</a>
  19.  
  20.  
  21. <?php
  22. if(isset($_POST['user'], $_post['pass'])) {
  23. if($_POST['user'] == $username && $_POST['pass'] == $password){
  24. echo "Success!";
  25. } else {
  26. echo "Error!";
  27. }
  28. }
  29. ?>
  30. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement