Guest User

Untitled

a guest
Apr 3rd, 2016
26
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. ini_set("display_errors", "1");
  3. error_reporting(E_ALL);
  4. session_start();
  5. $host = "localhost";
  6. $username = "sh150011";
  7. $password = "teeheee";
  8. $db_name = "sh150011_music";
  9. ($GLOBALS["___mysqli_ston"] = mysqli_connect("$host", "$username", "$password"))or die($error1);
  10. ((bool)mysqli_query($GLOBALS["___mysqli_ston"], "USE $db_name"))or die($error2);
  11.  
  12. $postlogin = $_POST['username'];
  13. $postpassword = $_POST['password'];
  14. $data = mysqli_fetch_object(mysqli_query($GLOBALS["___mysqli_ston"],
  15. "SELECT *,UNIX_TIMESTAMP(`online`) AS `online` FROM `users`
  16. WHERE `login`='{$postlogin}' AND `pass`=MD5('{$postpassword}')"));
  17.  
  18. if (isset($_POST["username"]) or isset($_POST["password"])) {
  19. sleep(1);
  20. if ($data) {
  21. $return_arr["status"] = 1;
  22. } elseif($_POST['inloggen'] AND !$data) {
  23. $return_arr["status"] = 0;
  24. } //end else
  25. else{
  26. $return_arr["status"] = 0;
  27. }
  28. echo json_encode($return_arr); // return value
  29. exit();
  30. }
  31.  
  32. ?>
Add Comment
Please, Sign In to add comment