[PHP] Xbox Live Gamertag Checker

Results 1 to 5 of 5
  1. #1
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    [PHP] Xbox Live Gamertag Checker

    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
    PHP Code:
    <?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=\"&raquo;\">
        </form>"
    ;
    }
    ?>
    Demo:
    http://mark-eriksson.com/php/xbl_gt_check.php

    Thanks,
    - m0nsta.
    Last edited by Markshall; 20-03-11 at 06:59 PM.


  2. #2
    Entrepreneur & Investor chadderbox is offline
    MemberRank
    Jun 2008 Join Date
    Look Behind YouLocation
    2,229Posts

    Re: [PHP] Xbox Live Gamertag Checker


  3. #3
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    Re: [PHP] Xbox Live Gamertag Checker

    Thanks chadderbox

  4. #4
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    Re: [PHP] Xbox Live Gamertag Checker

    I have got my site back now, so here is my real demo: http://mark-eriksson.com/php/xbl_gt_check.php

  5. #5
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    Re: [PHP] Xbox Live Gamertag Checker

    No problem and thanks, glad you like it :D



Advertisement