Guest User

Untitled

a guest
Apr 12th, 2018
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <?
  2.  
  3. include('../../../../httpdocs/API/dbconf.php');
  4. include('../../../../httpdocs/API/dbconnect.php');
  5. $iptriple = connect($dbconf['iptriple']);
  6.  
  7. if (isset($_REQUEST['Username']) && isset($_REQUEST['Password'])) {
  8. $number = $_REQUEST['Username'];
  9. $password = $_REQUEST['Password'];
  10.  
  11. mysql_real_escape_string($number);
  12. mysql_real_escape_string($password);
  13.  
  14. $encryptedpass = md5($password);
  15.  
  16. // query
  17. $query = "SELECT id, username, password, first_name, last_name FROM `ab_account` WHERE username IN ('$number') AND password IN('$encryptedpass');";
  18. $result = mysql_query($query, $iptriple) or die(mysql_error() . "There was an error with the query on line 17.");
  19.  
  20.  
  21. // check to make sure the user / pass combo is valid
  22. if (mysql_num_rows($result) > 0) {
  23. // set the resulting field array to $account
  24. $account = mysql_fetch_row($result);
  25.  
  26. $number = $account['username'];
  27. $name = $account['first_name'] . $account['last_name'];
  28.  
  29.  
  30. print "[DATA]\r\n";
  31. print "Success=1\r\n";
  32.  
  33.  
  34.  
  35.  
  36. } else {
  37. print "[DATA]\r\n";
  38. print "Success=0\r\n";
  39. print "Failure=\"Your username and password do not match!\"";
  40.  
  41. }
  42.  
  43.  
  44.  
  45. $fp = fopen("log.txt", "a+");
  46.  
  47. $data = $_GET;
  48.  
  49. $data = "<pre>" . print_r($data, 1) . "</pre>\n";
  50.  
  51. fwrite($fp, $data);
  52. fwrite($fp, "Username: " . $number . "\n");
  53. fwrite($fp, "Password: " . md5($password) . "\n");
  54. fwrite($fp, "Query: " . $query . "\n");
  55. //fwrite($fp, "DisplayName: " . $name . "\n");
  56.  
  57. fclose($fp);
  58.  
  59. } else {
  60. print "[DATA]\r\n";
  61. print "Success=0\r\n";
  62. print "Failure=You need to supply a username and password!";
  63.  
  64. }
  65.  
  66. ?>
Add Comment
Please, Sign In to add comment