views:

96

answers:

4

Hi there,

I am creating a website for someone for free (as a favor) however I in return will have my link at the bottom, How can I make it so the website will not work correctly if the link is removed? Also can I double up on this and allow it so I can remotely change the link?

Obviously I would be using either javascript for php (preferably php)

Is there any easy way of doing this? Or would it just be a matter of eval(base64_decode()); ?

Thanks, Stefan

A: 

You can't. There is no fool-proof way to do this, and no obfuscation and other trick is worth the effort. Simply check manually from time to time whether the link is still in place.

If you must have an automated solution, you could set up a crawler (e.g. using wget) that visits the site every two weeks and checks for whether the link is still there. But then, it could be kept in place, and simply made invisible using CSS... I really think a manual check is the best way to go.

Pekka
+5  A: 

With no offense intended, adding a "kill switch" that would render a design useless if your email address is removed sounds kind of evil. There's no sure-fire way to prevent someone from reverse-engineering the website's source code, even if you try some wacky Javascript hijinks that check the DOM for the presence of your email address.

Personally, although it's probably too late for this, I would recommend forming a contract with the client that stipulates that your contact information cannot be removed from the design. Legal checks can be stronger than technical ones, and I believe such is the case here.

Another question is raised: Why go into business with someone that you don't trust enough to give you credit for your work?

Yes, you can remotely change the link. The simplest way is to acquire FTP access to the client's host and simply change the source code on the deployed website.

Reinderien
I am doing it for a friend who is adding the content for their friend, It's just to make sure, and was mainly curiosity to be honest. Been thinking about making templates and how I could do this before. Thanks for your response anyway. Its a quick 2 hour job so I don't see the need for contracts :) Friends are friends, and that value is worth more than them to remove a link and I trust them!
Stefan
+2  A: 

Your effectiveness is dependent on the coding skills of the person you are doing the favor to. The only way to ensure that he doesn't change the url is for you to host it. Even if you give him a binary service that accesses a remote site for the url, a smart enough person can change the binary (yes, it might be hard to do). I would suggest making sure you trust the person and not doing it just for the link.

If you do it for the link, some simple obfuscation (like ROT13 or base64) often does a good job. You can support remote updates similarly.

Vineet
A: 

You could give them almost all the code. For instance, keep a chunk of Javascript hosted on a CDN site you control. This Javascript would be crucial for the page to work, and difficult to replace. In addition to the crucial functionality, this Javascript would ensure that your email address is present, inserting new DHTML elements if needed.

Of course they could just download your Javascript from the CDN, remove the part where you manipulate the DHTML, and host their own copy of the Javascript, altering the link in the HTML.

Ultimately, you're giving them source code with some license restrictions. There's little you can do to force them to comply if they're determined not to. You just have to do business with people who are going to cooperate.

Bill Karwin
Javascript hosted on a CDN can be viewed, copied and replaced on the server. The only way to make sure an external resource is depended upon is if that external resource is server-side. Either way, this introduces latency issues which I'm sure is more than enough reason to consider not doing it for most cases.
eyelidlessness