Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. <?php
  2. ## Database Information
  3. $database = array(
  4. "host" => "localhost",
  5. "user" => "root",
  6. "pass" => "",
  7. "dbse" => "shootsource"
  8. );
  9.  
  10. ## Connect To Database
  11. mysql_connect($database['host'], $database['user'], $database['pass']) or die("0-Database server is offline.");
  12. mysql_select_db($database['dbse']) or die("0-Database isn't available.");
  13.  
  14. ## All the other stuff...
  15. if (!empty($_GET['username']) && !empty($_GET['password'])) {
  16. $username = htmlspecialchars(mysql_real_escape_string($_GET['username']));
  17. $password = mysql_real_escape_string($_GET['password']);
  18.  
  19. $AQuery = sprintf("
  20. SELECT COUNT('id')
  21. FROM accounts
  22. WHERE name = '%s' AND password = '%s'",
  23. $username, $password);
  24. $aresult = mysql_query($AQuery);
  25. $atotal = mysql_result($aresult, 0);
  26. $reply = ($atotal > 0) ? true : false;
  27.  
  28. // return $reply;
  29. if ($reply) {
  30. echo '1';
  31. } else {
  32. echo '0-Wrong username or password.';
  33. }
  34. }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement