tags:

views:

70

answers:

4

i want the best php way to know if some one used my script of his server

+2  A: 

If you mean he took the code and put it in his code on his server, then you can't.

If you mean him 'hot linking' to a script on your server, then put some code to generate a js popup or something like that

BioBuckyBall
A: 

Place some code in your script that sends you an email with the name of the root address.. not sure how ethical that is.

Eton B.
ok but each refresh will send me
moustafa
+3  A: 

You have 2 choices (that I can think of):

  • Make your script "hot linking" something on your server.
  • Use CURL (or something similar) in your script to send something to your server (of course the end user can always remove these calls from your script).

Bottom line, this is quite unusual and unreliable (and can even break privacy policies), you should avoid this.

AlexV
+1. With either of these mechanisms, if your server is slow or goes down, it could negatively effect your users. Which is bad.
Frank Farmer
+3  A: 

The best way? Include a request in the header comment of the script saying to the effect of "if you use this script, please drop me a line at [email protected]".

Placing any hotlinks, pop-ups or any other kind of nonsense not only discourages people from using your script, but could actually impose a performance penalty and can be easily disabled.

If you don't want people to use your script, don't place it anywhere where the public can get to the source. If you want people to use it, don't obsess over usage....if it becomes popular you definitely will hear from users (who will be asking for enhancements and/or bug fixes).

Cal Jacobson