Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP Callback functions tracking your scripts
Old 04-21-2009, 10:18 AM PHP Callback functions tracking your scripts
Novice Talker

Posts: 6
Trades: 0
Hello Friends,

I was thinking about how php scripts creator know if a website use thier own php script , i mean when someone use a pirated copy of any php script

the creator of that script will know, so HOW ?


if i've created a php script and willing to track it in order to prevent someone to sharing it everywhere,

I mean how to know the domains that the script will be used at, hence i can ask them to buy a license and so on.

i think it is more better to save your work more than encryption tools

thanks in advance

Last edited by manal_nor; 04-21-2009 at 10:54 AM.. Reason: add me explain of wt i've ment
manal_nor is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-21-2009, 10:22 AM Re: PHP Callback functions tracking your scripts
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I've never heard the term callback apply to a PHP script, but it is a term used to describe a function which executes after another function is complete. The completing function needs to be a timed event, or something that takes a while to finish executing, while the rest of the script keeps operating.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-21-2009, 10:53 AM Re: PHP Callback functions tracking your scripts
Novice Talker

Posts: 6
Trades: 0
thanks wayfarer07
i ment , if i've created a php script and willing to track it in order to prevent someone to sharing it everywhere,

I mean how to know the domains that the script will be used at, hence i can ask them to buy a license and so on.

thanks in advance
manal_nor is offline
Reply With Quote
View Public Profile
 
Old 04-21-2009, 10:58 AM Re: PHP Callback functions tracking your scripts
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
There's not actually going to be a sure-fire way to do that, since the script could be modified to remove such tracking ability. However, you could make the script ping a certain web address which you control with the URL of the website that is running the script. The page that receives the ping would then store whatever information it receives in the database.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-21-2009, 11:15 AM Re: PHP Callback functions tracking your scripts
Novice Talker

Posts: 6
Trades: 0
Quote:
Originally Posted by wayfarer07 View Post
There's not actually going to be a sure-fire way to do that, since the script could be modified to remove such tracking ability. However, you could make the script ping a certain web address which you control with the URL of the website that is running the script. The page that receives the ping would then store whatever information it receives in the database.
I've tired the following

1- Create a php file call it track.php

Code:
<?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);
?>
2- then create a text file call it counter.txt

3- Upload both files at your website


4- The track function is
to be added in php script you wanna track it
where http://yoursite.com = your website where you stored track.php and counter.txt

Now when somone use the php script you wanna track it will send the url to the counter.txt ( must be CMOOD 0777 )

But

I've found it very bad one cause it makes the php script loading very slow
hence i give up using such one and i was searching for new way.

So if you have an idea , would be please share it !
manal_nor is offline
Reply With Quote
View Public Profile
 
Old 04-21-2009, 11:46 AM Re: PHP Callback functions tracking your scripts
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Here's a super simple way, though the disadvantage is it will show up in the HTML:
PHP Code:
echo '<iframe src="http://yoursite.com/track.php?url='.$_SERVER[HTTP_HOST].'&path='.$_SERVER[SCRIPT_FILENAME].'" style="display: none;"></iframe>'
Kinda silly, but it will work. I would have thought the example you gave would be the best way. It is what I would have tried first.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-21-2009, 12:16 PM Re: PHP Callback functions tracking your scripts
Novice Talker

Posts: 6
Trades: 0
Quote:
Originally Posted by wayfarer07 View Post
Here's a super simple way, though the disadvantage is it will show up in the HTML:
PHP Code:
echo '<iframe src="http://yoursite.com/track.php?url='.$_SERVER[HTTP_HOST].'&path='.$_SERVER[SCRIPT_FILENAME].'" style="display: none;"></iframe>'
Kinda silly, but it will work. I would have thought the example you gave would be the best way. It is what I would have tried first.
Well, 1st of all i'd like to say the idea of iframe is really very helpfull and solve the problem of slow loading

but the code you've directly added can't not used for the following reason

" the idea depends on open up a text file at following URL and write on it the url of the php script you wanna track "

hence the combination of iframe code and the full code
can be be as following

- We create a php file called X.php
- We add at x.php the following code
then at the php script we wanna track we add to it iframe code
PHP Code:
echo '<iframe src="X.php'" style="displaynone;"></iframe>'; 

It will load fast and also with no error cause i can't use only the link without the commands

Code:
@fread($f,10);
@fclose($f);
I hope you got wt i've ment

Now the problem

HOW TO PROTECT LOL THE X.PHP FILE

i found a good way in mind, lol we will add a function to the php script we wanna track to prevent edit or delete of x.php file

Say x.php file was 779 Bytes
then
Code:
if (file_exists("x.php")) {
 if (filesize("x") != 779) die();
} else {
 die();
}
so the x.php if it edited or deleted , the script won't work

further more thoughts
we can encrypt x.php with any stand alone encryption such as
TrueBug PHP Obfuscator

further more thoughts
we encrypt only x.php file and the file which contains the ifram code and the protection file function of x.php file

i think this gives a good protection for the script , if it used in another website it will gives you the url
if the owner deleted or edited x.php file the script won't work

LOL i know i maybe a silly girl but i'm try to use the most simple easy way to protect my script and in same time not bother the owner cause i hate zend and ioncube and such encryption and wt is called license per domain..ect


thanks for your help
manal_nor is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP Callback functions tracking your scripts
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28665 seconds with 12 queries