SHARE
TWEET

Untitled

a guest Oct 4th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?$command=$_POST['command'];  
  2. $databasehost="192.168.55.7";
  3. $databaseuser="unity";
  4. $databasepassword="unity";
  5. $database =  "unity3d";
  6. $db = mysql_connect ($databasehost,$databaseuser,$databasepassword);
  7. mysql_select_db ($database,$db);
  8. mysql_query('SET CHARACTER SET utf8');
  9. mysql_query('SET NAMES utf8');
  10.  
  11.  
  12.  
  13.  switch($command)
  14.  {
  15.      case "login":
  16.      $login =  $_POST['login'];
  17.      $pass = $_POST['pass'];    
  18. $res = mysql_query("SELECT * FROM users WHERE login='$login' AND pass='$pass'", $db );
  19. $res_myrow = mysql_fetch_array($res);
  20. $name = $res_myrow['name'];
  21. $id = $res_myrow['id'];  
  22.  
  23. if($id != "") {
  24.     echo '{"error": "ОК", "login": "' . $name . '", "id": ' . $id . '}';
  25.     } else {
  26.     echo '{"error": "Такого пользователя нет!!!"}';
  27.             }
  28.  
  29.  
  30. break;   
  31. }
  32.  
  33.  ?>
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
 
Top