Jump to content

Protection Function


egturnkey

Recommended Posts

Hello Dear Friends,

 

 

Consider we have an php file called

 

index.php

 

how can i add a code to (index.php) so that when it excute (run) on any website for example  (anysite.com)

 

it call an text file (license.txt) which is on my server and also in same time it record the URL of the (index.php) in another text file (record.txt)

 

 

WHAT FOR

 

 

it someone open ( index.php) it will record in a text file on my server the URL

if it was licensed then it will be okay and if not

then i remove the ( license.txt) and then index.php won't work

 

 

I've made the following code but it give some problems

 

 

on my server both

track.php and empty counter.txt

 

<?php
$url = @$_GET['url'];
$path = @$_GET['path'];
$entry_line = "$url | $path
"; //give ENTER to break into new line in text file
$fp = fopen("counter.txt","a");
fputs($fp,$entry_line);
fclose($fp);
?>

 

and the tacking code inside index.php

$f = @fopen("xxxxxxxxxxxxxxxxxxx/track.php?url=$_SERVER[HTTP_HOST]&path=$_SERVER[sCRIPT_FILENAME]","r");
@fread($f,10);
@fclose($f);

where xxxxxxxxxxxxxx is my website which i do stored the text file

 

 

PROBLEMS

 

1- It makes the website running so slow

2- it keeps store the URL everytime it open i mean has no overwrite option if same URL

 

My needs

 

any simple idea that makes me able to do the following

 

- know what url using the script ( index.php )

- if i changed license.txt , it won't load ( index.php ) or give warrning MSG not licensed please buy license

 

 

thanks in advance

 

it really will helps me a lot

Link to comment
Share on other sites

Licensing of software code is a pain, plus it's easy (for any programmer that can put 2 and 2 together) to 'null' your script (and thus bypassing your license).

 

The way you are doing it is wrong and it would be better to give users a serial that they enter into your script and everytime it runs (or only certain parts) it queries a script on your server to see if the license hasn't expired and is allowed to get updates. Then use Zend Guard to protect your source code. However this will only make it harder not impossible to null your script. To avoid that people want to null your script think of things that make your script a necessity for them, something that motivates them to renew their license instead of null'ing it.

 

Otherwise, If you truly want to protect your code then the best option is to host it yourself and let others pay you (yearly) for the hosting and the updates of which they benefit, but then again they may need some encouragment from time-to-time telling them why they are paying for your services and why they are worth every penny.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.