Advertisement
dumle29

Minecraft login

Mar 25th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. $user = $_POST['user'];
  2. $pass = $_POST['pass'];
  3. $response = file_get_contents('http://login.minecraft.net/?user='.$user.'&password='.$pass.'&version=12'); 
  4. $values = explode(':', $response);
  5. if(count($values) > 1)
  6. {
  7.     $user = $values[2];
  8.     $sessionId = $values[3];
  9.     $response = file_get_contents('http://session.minecraft.net/game/joinserver.jsp?user='.$user.'&sessionId='.$sessionId.'&serverId=1');
  10.     if($response == 'OK')
  11.     {
  12.     $_SESSION['valid'] = 1;
  13.     $_SESSION['redir'] = 'http://snuletek.org/site/mc/mcArch.php';
  14.     echo('
  15.         <script>
  16.             document.location = "http://snuletek.org/site/mc/mcArch.php";
  17.         </script>
  18.     ');            
  19.     }
  20. }
  21. else
  22. {
  23.     variableEcho(0, $user, 'Username or password incorrect, or you don\'t own minecraft'); //My function to echo the html form with previously entered values preserved, and in this case, an error message.
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement