Guest User

Untitled

a guest
Mar 16th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. require 'config.php';
  5.  
  6. $db = sqlite_open('data.php');
  7. //
  8. $Username = sqlite_escape_string(stripslashes($_POST['user']));
  9. $Password = (sqlite_escape_string(stripslashes($_POST['pass'])));
  10. $query = "SELECT * FROM data WHERE user = '$Username' AND password = '$Password'";
  11.  
  12. if($Username == "")
  13. {
  14. echo "Whoops... looks like you forgot your name!";
  15. echo "$Username";
  16. exit();
  17. }
  18. if ($password == "")
  19. {
  20. echo "Uhm.. You forgot to enter your password!";
  21. header('Refresh: 4; url=login.php');
  22. exit();
  23. }
  24. sqlite_query($db,$query);
  25. if ($query == true)
  26. {
  27. echo "Thanks for logging in, Our System will redirect you shortly.";
  28. @session_start();
  29. @$_SESSION['User'] = $Username;
  30. header('Refresh: 4; url=index2.php');
  31. exit();
  32. }
  33. else
  34. {
  35. echo "<p>You may have entered an incorrect username and or password.<br /><a href=\"login.php\">Redirect Me</a></p>";
  36. header('Refresh: 4; url=login.php');
  37. exit();
  38. }
  39. ?>
Add Comment
Please, Sign In to add comment