سؤال

I am developing a website for a small company and have added the copyright for their company and next to it saying it was designed by my company.

The HTML code:

<p>Copyright © 2012 Teguise Broker | Designed by <?php include 'copyright.php'; ?></p>

The PHP code:

<?php echo "<a href='http://www.my-company.org'>My Company</a>"; ?>

What I want to do is try and make the HTML code non-removable or if they do try to remove it, the page doesn't display. Help would be really appreciated.

هل كانت مفيدة؟

المحلول

There is no way to absolutely stop them if they have access to the source code. The best you can do is make it difficult for them to remove it. A PHP obfuscator would be the best way to complicate it for them. But see this answer for why you shouldn't bother.

نصائح أخرى

This is kind of a weird question, but if the client has all the source files, there is no way you can ensure the copyright notice. If you want to be sneaky about it, roll your own copy of jQuery and add a method that checks the existence of the copyright element to work something like this on page load -

function validate() {
    var copy = document.getElementById("copyright");
    if (!copy) {
        var html = document.getElementsByTagName("html")[0];
        var body = document.getElementsByTagName("body")[0];
        html.removeChild(body);
    }
}

But of course, this is a way to drag your reputation through the mud as others have mentioned. I'd argue that positive word of mouth is far more effective than a footer link. If you want to keep the link for SEO or advertising purposes, then offer the client a discount in order to keep the link in place. That way, everyone stays happy.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top