Skip to content

Instantly share code, notes, and snippets.

@Meroje

Meroje/premium.php

Created Nov 9, 2012
Embed
What would you like to do?
Vérifie les infos minecraft de l'utilisateur
<?php
session_start();
$logged = false;
$error = false;
if(isset($_POST['valider']))
{
$pseudo=(isset($_POST["pseudo"])) ? filter_var($_POST["pseudo"], FILTER_SANITIZE_STRING) : null;
$password=(isset($_POST["password"])) ? filter_var($_POST["password"], FILTER_SANITIZE_STRING) : null;
$url = "https://login.minecraft.net/?user=$pseudo&password=$password&version=99999";
$response = explode(" ", file_get_contents($url));
//die(var_dump($response));
if(count($response) == 1) {
list($version,$ticket,$username,$session_on) = explode(":", $response);
var_dump($version,$ticket,$username,$session_on);
$logged = true;
$error = false;
} else {
$error = "Mauvais identifiants, veuillez réessayer";
if ($response[0] == 'Account')
{
$error = "Votre compte a été migré, utilisez votre addresse mail.";
}
}
if ($logged === true && $error === false) {
$_SESSION['pseudo'] = $username;
header('Location: /shop.php');
die();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.