Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <?php
  2.  
  3. function clean($string) {
  4.  
  5. $string = trim($string); // Strip whitespace from the beginning of a string.
  6. $string = strip_tags($string); // Strip HTML and PHP tags.
  7.  
  8. if (!get_magic_quotes_gpc()) { // Returns 0 if magic_quotes_gpc is off, 1 otherwise.
  9.  
  10. $string = addslashes($string);
  11.  
  12. }
  13.  
  14. $string = rtrim($string); // Strip whitespace from the end of a string.
  15.  
  16. return $string; // Return the final string.
  17. }
  18.  
  19.  
  20. $username = $_GET['username'];
  21. $password = $_GET['password'];
  22.  
  23. mysql_connect("localhost", "YOUR USER", "YOURvPASS") or die(mysql_error());
  24. mysql_select_db("runehubc_rscbot") or die(mysql_error());
  25.  
  26. //$result = mysql_query("SELECT password, bAccess FROM `smf_members` WHERE member_name = '" . clean($username) . "'");
  27.  
  28. $result = mysql_query("SELECT password, bAccess FROM `smf_members` WHERE member_name = '" . clean($username) . "'");
  29.  
  30. if(mysql_num_rows($result) > 0){
  31. $row = mysql_fetch_array( $result );
  32. //$row = mysql_fetch_row($result);
  33. if($row['password'] == $password){
  34. echo $row['bAccess'];
  35. } else {
  36. echo "Incorrect Password";
  37. }
  38. } else {
  39. echo "Incorrect Username";
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement