Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. <?php
  2. include 'conn.php';
  3. mysql_select_db("account");
  4. $username = $_POST["user"];
  5. $password = $_POST["pass"];
  6. $pg = $_POST['nomepg'];
  7. $strSQL ="SELECT id FROM account WHERE login = '$username' AND password = password('$password')";
  8. $risultato = mysql_query($strSQL);
  9. if (! $risultato)
  10. {
  11. echo ("L'account non esiste, controlla i dati");
  12. exit();
  13. }
  14. $id = mysql_result($risultato, 0, 'id');
  15. mysql_select_db("player");
  16. $strSQL ="SELECT empire FROM player_index WHERE id = '$id'";
  17. $risultato = mysql_query($strSQL);
  18. if (! $risultato)
  19. {
  20. echo("Errore nela query");
  21. exit();
  22. }
  23. $impero = mysql_result($risultato, 0, 'empire');
  24. if ($impero == 1)
  25. {
  26. $map = "61";
  27. $x = "436377";
  28. $y = "215769";
  29. }
  30. if ($impero == 2)
  31. {
  32. $map = "61";
  33. $x = "436377";
  34. $y = "215769";
  35. }
  36. if ($impero == 3)
  37. {
  38. $map = "61";
  39. $x = "436377";
  40. $y = "215769";
  41. }
  42. $strSQL ="UPDATE player SET x='$x', y='$y', map_index='$map', exit_x='$x', exit_y='$y', exit_map_index='$map' WHERE name='$pg'";
  43. $risultato = mysql_query($strSQL);
  44. if (! $risultato)
  45. {
  46. echo ("Comando invalido");
  47. exit();
  48. }
  49. echo ("Utente teletrasportato al Monte Sohan, sei pregato di attendere 15 minuti prima di effettuare un nuovo login");
  50. mysql_close($conn);
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement