Advertisement
NoHatred0

Untitled

Jul 26th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. include_once './storage.php';
  6.  
  7. $htmlContent = file_get_contents('./login_form.html');
  8.  
  9. if(count($_POST))
  10. {
  11. if(isset($_POST['username'], $_POST['password']))
  12. {
  13. $user = getUserByUserPass($_POST['username'], $_POST['password']);
  14.  
  15. if($user !== false)
  16. {
  17. $_SESSION['user'] = $user;
  18. header('Location: ./login_status.php');
  19. exit;
  20. }
  21. else
  22. {
  23. $htmlContent .= '<br/><hr style="width: 50%; float: left;"/><br/><strong>No such user.</strong>';
  24. }
  25. }
  26. }
  27.  
  28. echo $htmlContent;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement