This literally took me 5 minutes to code.
All it does is checks if a Xbox Live Gamertag is available for you to use.
You simply enter a gamertag and press the button.
index.php
Demo:
Thanks,
- m0nsta.
All it does is checks if a Xbox Live Gamertag is available for you to use.
You simply enter a gamertag and press the button.
index.php
PHP:
<?php
if( $_POST['check'] )
{
$gt = strip_tags( $_POST['gt'] );
$exists = false;
if( empty( $gt ) )
{
header( "Location: " . $_SERVER['PHP_SELF'] );
}
else
{
$check_url = "http://gamercard.xbox.com/en-GB/" . $gt . ".card";
$check_url_source = file_get_contents( $check_url );
$exists = ( eregi( "<div class=\"Stat\">--</div>", $check_url_source ) && eregi( "<div class=\"NoGame\"></div>", $check_url_source ) ) ? false : true;
echo ( $exists == true ) ? "The gamertag <strong>" . $gt . "</strong> is already in use!" : "The gamertag <strong>" . $gt . "</strong> is not in use! You are free to use it.";
}
}
else
{
echo "Enter a Xbox Live Gamertag to see if it is already in use.<br>
<form method=\"post\">
<input type=\"text\" name=\"gt\" value=\"\" maxlength=\"1000\"> <input type=\"submit\" name=\"check\" value=\"»\">
</form>";
}
?>
Demo:
You must be registered for see links
Thanks,
- m0nsta.