Prevent script for sinle domain

Discussion in 'PHP' started by Om ji Kesharwani, Aug 28, 2010.

  1. #1
    I have developed a script for my client, he asked me for the source code but i want to
    set the validation to use the script for single domain only. A client should not b able to run another copy of that script without prior notice.
     
    Om ji Kesharwani, Aug 28, 2010 IP
  2. Wolf Security

    Wolf Security Peon

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if ($_SERVER['HTTP_HOST'] != "www.allowed.com")
    {
        header("Location: http://www.google.lv");
    }
    PHP:
     
    Wolf Security, Aug 28, 2010 IP
  3. Om ji Kesharwani

    Om ji Kesharwani Peon

    Messages:
    211
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks but it can be easily edited by the client. As i described he wants the source code. Any other solution??????
     
    Om ji Kesharwani, Sep 1, 2010 IP
  4. onetouch

    onetouch Member

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #4
    Set up a simple script on your end that just outputs www.allowed.com as text. Then you would call that script from his tool and check the result (with curl). If the result is not the same as the current domain the tool is hosted on than use something like die(); or else don't do anything. Now just encode this part of the code in his script and put in some global variables that are needed for the script to run. That way if he deletes this code the script won't work.

    Hope you understand what I mean

    Thanks :)
     
    onetouch, Sep 1, 2010 IP
  5. Wolf Security

    Wolf Security Peon

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Encode it ( Zend, .. ).
     
    Wolf Security, Sep 2, 2010 IP
  6. Om ji Kesharwani

    Om ji Kesharwani Peon

    Messages:
    211
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Without encoding?
     
    Om ji Kesharwani, Sep 2, 2010 IP