SHARE
TWEET

xd

a guest Jun 15th, 2017 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. include('db.php');
  4.  
  5. $action = $_GET['action'];
  6.  
  7. $username = $con->real_escape_string($_GET['username']);
  8. $password = $con->real_escape_string(md5($_GET['password']));
  9.  
  10. if(!$action)
  11. {
  12.     echo "Eror";
  13. }
  14. else
  15. {  
  16.     if($action == "register_admin_xd")
  17.     {
  18.         if($query = $con->query("INSERT INTO users (username,password) VALUES ('$username','$password')"))
  19.         {
  20.             echo "1";
  21.         }
  22.         else
  23.         {
  24.             echo "0";
  25.         }
  26.     }
  27.     else if($action == "login3")
  28.     {
  29.         $query = $con->query("SELECT * FROM users WHERE username = '$username' and password = '$password'");
  30.         $cnt = $query->num_rows;
  31.        
  32.         if($cnt > 0)
  33.         {
  34.             echo "1";
  35.         }
  36.         else
  37.         {
  38.             echo "0";
  39.         }
  40.     }
  41.     else if($action == "getrank")
  42.     {
  43.          $sql = "SELECT 'rank' FROM 'users' WHERE 'username' like '$username'";
  44.          $result = $con->query($sql);
  45.  
  46.     if ($con && ($result->num_rows > 0))
  47.     {
  48.         // output data of each row
  49.         while($row = $result->fetch_assoc())
  50.         {
  51.             echo $row["topic"]. "<br>";
  52.         }
  53.     } else {
  54.          printf("Connect failed: \n"));
  55.     }
  56.     }
  57.     else
  58.     {
  59.         echo "Error";
  60.     }
  61. }
  62.  
  63. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top