Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. $username = "bruker";
  4. $password = "hei";
  5. $operation = $_GET['do'];
  6. $input_username = $_POST['username'];
  7. $input_password = $_POST['password'];
  8.  
  9. if ($operation == login) {
  10.  
  11. if ($input_username && $input_password) {
  12.  
  13. if ($input_username == $username && $input_password == $password) {
  14.  
  15. redirect("../index.html");
  16.  
  17. } else { echo "feil brukernavn/passord"; }
  18.  
  19. } else { echo "Du må fylle inn både brukernavn og passord"; }
  20.  
  21. } else {
  22. ?>
  23. <form method="POST" action="index.php?do=login">
  24. Username: <input type="text" name="username" size="15" /><br />
  25. Password: <input type="password" name="password" size="15" /><br />
  26. <div align="center">
  27. <p><input type="submit" value="Login" /></p>
  28. </div>
  29. </form>
  30. <?php
  31. }
  32.  
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement