php setting a trial period

Discussion in 'PHP' started by cavendano, Sep 29, 2007.

  1. #1
    I have a customer that would like to use one of my scripts for a trial period what would be the easiest way of coding the script to set an expiration date? I can encode the script so that he cannot modify dates and such...so it doesnt matter how simple the code is....any help would be appreciated.
     
    cavendano, Sep 29, 2007 IP
  2. bubbles19518

    bubbles19518 Peon

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Base64 encode the script, salt it. Then use PHP to de-salt, decode and run the decrypted code through eval().
     
    bubbles19518, Sep 29, 2007 IP
  3. tandac

    tandac Active Member

    Messages:
    337
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #3
    if (time()>x) {
    echo "Sorry the script has expired"
    exit;
    }
     
    tandac, Sep 29, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    ^^ And he could just change the time on his host and use the script as long as he wants.
     
    nico_swd, Sep 30, 2007 IP
  5. wvccboy

    wvccboy Notable Member

    Messages:
    2,632
    Likes Received:
    81
    Best Answers:
    1
    Trophy Points:
    250
    #5
    I'd suggest use ionCube or Zend to time encode it.

    Another option is, use the
    code on your own server, and have his script call your server.

    So in his file you would have

    <?php
    .
    ..
    ...
    ....
    .....more php

    include("http://www.mysite.com/trial.php");

    .....
    ....
    ...
    ..
    ..
    ?>

    And then encode the file as you wish. This way the script still calls your server anyhow for the time.
     
    wvccboy, Oct 1, 2007 IP
  6. sdemidko

    sdemidko Member

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #6
    and even more - you can store the date on your own server and check it every time user use cms (not on every page)
     
    sdemidko, Oct 2, 2007 IP