Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. <?php
  2. define("WEBSITE_TITEL", "<title> Dit is een titel </title>");
  3. echo WEBSITE_TITEL;
  4. session_start();
  5. if(isset($_POST['Submit'])){
  6. // This is the array where the login files are located.
  7. $logins = array(
  8. 'Alex' => '123456',
  9. 'Sem' => 'password1',
  10. 'test' => 'test',
  11. 'Lars' => 'csgo4life');
  12. // This is the control for the usernames and passwords
  13. $Username = isset($_POST['Username']) ? $_POST['Username'] : '';
  14. $Password = isset($_POST['Password']) ? $_POST['Password'] : '';
  15. // If the username from the array "logins" match with the password from the array "Logins"
  16. if (isset($logins[$Username]) && $logins[$Username] == $Password){
  17. //If the enrty of the password is correct then go too...
  18. $_SESSION['UserData']['Username']=$logins[$Username];
  19. // It's going to direct you to the index.php
  20. header("location:index.php");
  21. //Exits the php
  22. exit;
  23. } else {
  24. //If the password is uncorrect then show the message that the pasword is uncorrect.
  25. $msg="<span style='color:#FF0000'>De Login gegevens komen niet overeen</span>";
  26. }
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement