Advertisement
Guest User

Untitled

a guest
Mar 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. if ($_POST['submit']) {
  5. $member_username = "kalevi";
  6. $member_password = "salasana";
  7.  
  8. $username = $_POST['username'];
  9. $password = $_POST['password'];
  10.  
  11. if ($username == $member_username && $password == $member_password) {
  12. $_SESSION['username'] = $username;
  13. header('Location: checkLogin.php');
  14. } else {
  15. echo "Väärä salasana tai käyttäjätunnus";
  16. }
  17. }
  18. ?>
  19.  
  20. <!DOCTYPE html>
  21. <html>
  22.  
  23. <head>
  24.  
  25. </head>
  26.  
  27. <body>
  28.  
  29. <h1>Kirjaudu sisään palvelimeen</h1>
  30.  
  31. <form action="checkLogin.php" method="POST">
  32.  
  33. <input type="text" name="username" placeholder="käyttäjätunnus" /><br />
  34. <input type="passqord" name="password" placeholder="salasana" /><br />
  35. <input type="submit" name="login" value="Login" />
  36.  
  37. </form>
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement