Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: PHP Help

  1. #21
    Join Date
    Jun 2007
    Location
    England
    Posts
    495
    Tokens
    0

    Default

    Bump this post as still need help XD


  2. #22
    Join Date
    May 2007
    Posts
    467
    Tokens
    0

    Default

    okay well i think your still needing the server bit this is only to show to it will or may not work.
    Code:
    $server = $_GET[server];
    $license = mysql_query("SELECT * FROM license WHERE server= '$server'");
    $license = mysql_fetch_array($license);
    if($license == "0") 
    {
    die('No license at this url.');
    }
    elseif($license[stats] == "suspended") 
    {
    die('Your license has been suspended.');
    }

  3. #23
    Join Date
    Jun 2007
    Location
    England
    Posts
    495
    Tokens
    0

    Default

    Quote Originally Posted by VistaBoy View Post
    okay well i think your still needing the server bit this is only to show to it will or may not work.
    Code:
    $server = $_GET[server];
    $license = mysql_query("SELECT * FROM license WHERE server= '$server'");
    $license = mysql_fetch_array($license);
    if($license == "0") 
    {
    die('No license at this url.');
    }
    elseif($license[stats] == "suspended") 
    {
    die('Your license has been suspended.');
    }
    Thanks XD
    you can delete it now becasue ur making one yourself witch i plan to use when its out


  4. #24
    Join Date
    Jan 2007
    Location
    Canada eh?
    Posts
    766
    Tokens
    75

    Default

    Well.... heres a little insight....

    The Script
    PHP Code:
    <?php
    $d 
    $_SERVER['HTTP_HOST']; //Get current domain
    $d1 str_replace('www.'''$d); //Remove unwanted stuff
    $domain str_replace('w3.'''$d1); //And removing more...
    $result mysql_query("SELECT license FROM settings"); //Get license 
    $row mysql_fetch_array($result);
    $license $row['license'];
    if(
    $file = @file_get_contents("http://licensing.yoursite.com?d=$domain&l=$license")){
        echo 
    $file;
    }else{
        echo 
    'Could not connect to licensing server.';
    ?>
    Your Server
    PHP Code:
    <?php
    //Connect To Your License DB Here
    $d $_GET['domain'];
    $l $_GET['license'];
    if(
    $domain != ""&&$license != ""){
        
    //Get Licenses From Your DB
        
    $ls mysql_query("SELECT * FROM licenses WHERE license = '$l'"); //Check db for license
        
    $i mysql_fetch_array($ls);
        
    $count mysql_query("SELECT COUNT(id) FROM licenses WHERE license = '$l'"); //Count instances found
        
    $total mysql_num_rows($count);
        if(
    $total == "1"&&$d $i['domain']){ //What happens if the license is valid
            
    echo 'Yay! Your license is valid.';
        }else{ 
    //What happens if it can't verify license
            
    echo 'Could not validate license. Please contact us.';
            echo 
    '<meta http-equiv="refresh" content="2;url=http://licensing.yoursite.com/error.php">';
        }
    }
    ?>
    Don't use that exact code but its something to build on Hope it helps!

    Note: The domains should be listed as "yoursite.com" not "www.yoursite.com" or "http://yoursite.com" for the above to work properly.

    (Refer to code commenting for help as to what does what)
    Last edited by QuickScriptz; 20-11-2007 at 12:40 AM. Reason: Added code comments

  5. #25
    Join Date
    Jun 2007
    Location
    England
    Posts
    495
    Tokens
    0

    Default

    Thanks Scriptz +rep if i can XD and vistaboy


Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •