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 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default Flat file licenceing

    PHP Code:
     <?
     $domain 
    $_SERVER['HTTP_HOST'];
     
    $fp fopen('http://thinktropica.com/licence.txt','r');
     if (!
    $fp) {
     echo (
    "Licence file is non-exestient"); 
     exit;
     } 
     while (!
    feof($fp)) {
     
    $line fgets($fp1024);
     list (
    $site1$site2$site3) = split ('\|'$line);
    if (
    $site1 == ($domain)) {
    echo(
    "You have a licence :O");
    } else {
    if (
    $site2 == ($domain)) {
    echo(
    "You have a licence :O"); 
    } else {
    if (
    $site3 == ($domain)) {
    echo(
    "You have a licence :O"); 
    } else {
    echo(
    "This Domain has no valid licence. Sorry");
    }
    }
    }
     
    $fp++;
     }
     
     
    fclose($fp);
     
     
    ?>
    Right iv done this but im not sure how to so it so instead of having $site1, $site2, ect.. i can just use $sites

    and it will check if hello.com|hilloooglgg.com|woof.org|

    instead of defining each one meaning hello.com = $site1 ect..

    any ideas?

  2. #2
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    foreach($thearray as $key => $value) {
    //do stuff here.


  3. #3
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    thanks mate

  4. #4
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Can I point out, it'd be rather easy to take that out of your code, which would make the application work regardless of whether you were liscenced. Also, it's rather insecure having all the sites that your application is used by in a text file. If I were you, I'd be using some sort of database on your side. The script would go to a PHP file on your server (eg. ./checkliscence?site=www.site.com). If the site was licenced, it would echo back yes, you would continue. If it wasn't liscenced, echo no, script halts.

  5. #5
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    dont worry im not dumb enough to just let people take the code out am i?

    im going to make that code dependent in alot of files and if it isnt there in the main file then it will not work also all files will be encripted.

  6. #6
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Files will be encrypted? I'm intrigued. Please explain further.

  7. #7
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Don't place a license check in loads of files as this will cause inconvenience to the user as well as bog down your server.

    Quote Originally Posted by Mattx.org View Post
    dont worry im not dumb enough to just let people take the code out am i?

    im going to make that code dependent in alot of files and if it isnt there in the main file then it will not work also all files will be encripted.

  8. #8
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    Quote Originally Posted by benzoenator View Post
    Files will be encrypted? I'm intrigued. Please explain further.
    PHP Code:
    <?php $_F=__FILE__;$_X='Pz4gPD8NCiAkZDJtMTRuID0gJF9TRVJWRVJbJ0hUVFBfSE9TVCddOw0KICRmcCAgPSBmNGw1KCdodHRwOi8vdGg0bmt0cjJwNGMxLmMybS9sNGM1bmM1LnR4dCcpOw0KZjJyNTFjaCgkZnAgMXMgJGs1eSA9PiAkdjFsKSANCnsNCiAgICAgJGQxdDFbJGs1eV0gPSA1eHBsMmQ1KCJ8fCIsICR2MWwpOw0KfQ0KDQpmMnIoJGsgPSAwOyAkayA8IHM0ejUyZigkZnApOyAkaysrKSANCnsgDQogIDRmICgkZDF0MVska11bMF0gPT0gJGQybTE0bikgeyANCjVjaDIoIlNjcjRwdCA0bmNsM3M0Mm4gdzRsbCBiNSBoNXI1IDopIik7DQp9IDVsczUgeyANCjVjaDIoIiRkMm0xNG4gSDFzIG4yIGw0YzVuYzUuIik7DQp9DQp9DQo/Pg==';eval(base64_decode('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));?>
    Put that on your server then look @ it then tell me your domain and ill give it license.

  9. #9
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Thats not really encoded though.

    PHP Code:
    <?
     $domain 
    $_SERVER['HTTP_HOST'];
     
    $fp  file('http://thinktropica.com/licence.txt');
    foreach(
    $fp as $key => $val
    {
         
    $data[$key] = explode("||"$val);
    }

    for(
    $k 0$k sizeof($fp); $k++) 

      if (
    $data[$k][0] == $domain) { 
    echo(
    "Script inclusion will be here :)");
    } else { 
    echo(
    "$domain Has no licence.");
    }
    }
    ?>
    If you want drop me a PM and I can encode it with Zend Encoder for you.


    Quote Originally Posted by Mattx.org View Post
    PHP Code:
    <?php $_F=__FILE__;$_X='Pz4gPD8NCiAkZDJtMTRuID0gJF9TRVJWRVJbJ0hUVFBfSE9TVCddOw0KICRmcCAgPSBmNGw1KCdodHRwOi8vdGg0bmt0cjJwNGMxLmMybS9sNGM1bmM1LnR4dCcpOw0KZjJyNTFjaCgkZnAgMXMgJGs1eSA9PiAkdjFsKSANCnsNCiAgICAgJGQxdDFbJGs1eV0gPSA1eHBsMmQ1KCJ8fCIsICR2MWwpOw0KfQ0KDQpmMnIoJGsgPSAwOyAkayA8IHM0ejUyZigkZnApOyAkaysrKSANCnsgDQogIDRmICgkZDF0MVska11bMF0gPT0gJGQybTE0bikgeyANCjVjaDIoIlNjcjRwdCA0bmNsM3M0Mm4gdzRsbCBiNSBoNXI1IDopIik7DQp9IDVsczUgeyANCjVjaDIoIiRkMm0xNG4gSDFzIG4yIGw0YzVuYzUuIik7DQp9DQp9DQo/Pg==';eval(base64_decode('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));?>
    Put that on your server then look @ it then tell me your domain and ill give it license.

  10. #10
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Oh Zend Encoder... Forgive me, I thought you were talking about something else

    I still think you should be using some sort of check on your site through a database, rather than a text file >_>

Page 1 of 2 12 LastLast

Posting Permissions

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