Page 4 of 5 FirstFirst 12345 LastLast
Results 31 to 40 of 48

Thread: PHPLock

  1. #31
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    Can we have a look at the coding please


    EDIT: only joking

  2. #32
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    I posted a simple one

    I didn't go into anything deeper then just that.

  3. #33
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Quote Originally Posted by Dentafrice View Post
    I posted a simple one

    I didn't go into anything deeper then just that.
    Cool give me a link

    Offtopic:

    Your name is nearly toothpaste in a diff language (it needs to be Dentifrice)

  4. #34
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Yep, I knew that.

    Dentifrice (Denti being the latin prefix for tooth, frice for paste)

    Dent EEE frice vs Dent UHHHH Frice

    I am southern so down here we say, Dentuhfrice

  5. #35
    Join Date
    Dec 2006
    Posts
    521
    Tokens
    0

    Default

    Quote Originally Posted by Tomm View Post
    Its more advanced that the script posted

    I won't go into detail but it uses tokens and encrypts certain things and does not just say "active" or anything like that (It does not sent any readable text).
    Yeh but at the end of the day if the file is encoded or whatever why does it matter, unless you give out the liscencing link and the get variables or whatever.

    Quote Originally Posted by Dentafrice View Post
    I posted a simple one

    I didn't go into anything deeper then just that.
    You did what was needed, nothing more "advanced" is needed really.

    And 15pounds, IMO is quite expensive, but profitable hehe

  6. #36
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Yeah, its a simple way of protecting something.

    Nothing more is really needed. You could make it output 1, 2, 3 or any number and

    if($response == "1") {
    do something
    }

    and so on.

  7. #37
    Join Date
    Jan 2007
    Posts
    190
    Tokens
    0

    Default

    Quote Originally Posted by Dentafrice View Post
    Pretty much, unless you encrypt it


    PHP Code:
    <?
    // Simple thingy
    // Coded in quick reply box so its probably bad
     
    $server $_SERVER['SERVER_NAME'];
    $when date("r");
    $response file_get_contents("http://lockplace.com/lock/lock.php?server=$server&time=$when");
     
    if(
    $response == "active") {
     
    }else{
    if(
    $response == "expired") {
    echo 
    "Your license has expired";
    exit;
    }
    if(
    $response == "suspended") {
    echo 
    "Your license has been suspended";
    exit;
    }
    if(
    $response == "none") {
    echo 
    "Are j00 stupid, you don't even have a license for this domain";
    exit;
    }
     
    }
    ?>
    Thats pretty much it for the check script, you still need to write the lock.php

    I will make one of these tonight or tomorrow
    Cool when are you going to make the lock.php???

  8. #38
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    I will make a simple one tonight, deal?

    Won't be encoded or nothing.

  9. #39
    Join Date
    Jan 2007
    Posts
    190
    Tokens
    0

    Default

    Ok cool thank you.

    All the people who use it, will have to give you thanks for your time.

  10. #40
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Here is a Sample config file for the people using the system (customers);

    PHP Code:
    <?
    // Sample Config
    include "licensing.php";

    $server "localhost";
    $username "this_username";
    $password "1337";
    $database "test";


    // License
    $key "wafr5156dsf1a561";
    ?>
    Here is licensing.php (to be included in the config file):

    PHP Code:
    <?
    // Simple thingy
    // Coded in quick reply box so its probably bad
    include "config.php";
    $server $_SERVER['SERVER_NAME'];
    $when date("r");
    $response file_get_contents("http://lockplace.com/lock/lock.php?server=$server&time=$when&key=$key");
     
    if(
    $response == "active") {
     
    }else{
    if(
    $response == "expired") {
    echo 
    "Your license has expired";
    exit;
    }
    if(
    $response == "suspended") {
    echo 
    "Your license has been suspended";
    exit;
    }
    if(
    $response == "none") {
    echo 
    "Are j00 stupid, you don't even have a license for this domain";
    exit;
    }
     
    }
    ?>
    Lock.php
    PHP Code:
    <?
    // LockIT 
    // lock.php V1.0

    include "config.php";

    $server $_GET[server];
    $time $_GET[time];

    $serverq mysql_query("SELECT * FROM license WHERE server='$server'");
    $servern mysql_num_rows($serverq);

    if(
    $servern == "0" || $servern == "") {
        echo 
    "none";
        exit;
    }

    $licenseq mysql_query("SELECT * FROM license WHERE server='$server' ORDER BY id DESC LIMIT 0,1");
    $licenser mysql_fetch_array($suspendq);
    if(
    $licenser[status] == "active") {
        echo 
    "active";
        exit;
    }else{
    if(
    $licenser[status] == "suspended") {
        echo 
    "suspended";
        exit;
    }

    $today date("r");
    if(
    $licenser[expire] == "$today") {
        
    mysql_query("UPDATE license SET status='$suspended' WHERE id='$licenser[id]' LIMIT 0,1");
        echo 
    "expired";
        exit;
    }
    }    
    ?>
    Config.php

    PHP Code:
    <? 
    // http://www.calebmingle.com

    $server "localhost";

    $username "";

    $password "";

    $database "";

    mysql_connect($server$username$password);

    ?>
    SQL:

    PHP Code:
    CREATE TABLE `license` (
      `
    idint(10NOT NULL auto_increment,
      `
    servertext NOT NULL,
      `
    expiretext NOT NULL,
      `
    keytext NOT NULL,
      
    PRIMARY KEY  (`id`)
    ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=
    Sample license:
    PHP Code:
    INSERT INTO `licenseVALUES (1'www.calebmingle.com''''wafr5156dsf1a561'); 
    Date should be in this format:
    Sat, 12 May 2007 19:58:08 -0500

    Kind of confusing, but if your smart you should be able to figure it out.

    I whipped it up kind of fast.

Page 4 of 5 FirstFirst 12345 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
  •