Non-removable copyright text in footer

两盒软妹~` 提交于 2019-12-08 10:52:11

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/10359560/non-removable-copyright-text-in-footer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!