Guest User

Untitled

a guest
Jul 30th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?php
  2. require('../functions.php');
  3. require('../config.php');
  4.  
  5.  
  6. if($_GET['crypt'] == 8898753125564561 && isset($_GET['name']) && isset($_GET['pass']))
  7. {
  8.     //replace spaces with an underscore (_)
  9.     //clean the query with mysql_real_escape_string
  10.     $name = mysql_real_escape_string(str_replace('_', ' ', $_GET['name']));
  11.     $password = md5(sha1(md5(sha1(strtolower($_GET['password'])))));
  12.    
  13.     $query = mysql_query("SELECT `acc_status` FROM users WHERE username = '$name' AND password = '$password' LIMIT 1");
  14.    
  15.     if(mysql_num_rows($query) >= 1)
  16.     {
  17.         //successfull login
  18.         //lets return their rank
  19.        
  20.         $rank = mysql_fetch_assoc($query);
  21.        
  22.         //return their rank
  23.         //0 == banned
  24.         //1 == user
  25.         //2 == forum_moderator
  26.         //3 == administrator
  27.         echo $rank['acc_status'];
  28.     }
  29.     else
  30.     {
  31.         //incorrect password/username combination
  32.         echo -1;
  33.     }
  34. }
  35. else
  36. {
  37.     //something failed (either incorrect crypt ID or a required field is missing)
  38.     echo -2;
  39. }
  40. ?>
Add Comment
Please, Sign In to add comment