Advertisement
Guest User

Ian

a guest
Oct 24th, 2010
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2. ## Database Information
  3. $database = array(
  4.         "host" => "localhost",
  5.         "user" => "root",
  6.         "pass" => "",
  7.         "dbse" => ""
  8.         );
  9.  
  10. ## Connect To Database
  11. mysql_connect($database['host'], $database['user'], $database['pass']) or die("An Error Has Occured - Please Contact An Administrator (REF#S10)");
  12. mysql_select_db($database['dbse']) or die("An Error Has Occured - Please Contact An Administrator (REF#S11)");
  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 'true';
  31.     } else {
  32.         echo 'false';
  33.     }
  34. }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement