-11

I am trying to add a powered by link in footer in my own website that i developed. i tried a jquery method to check that this this link exist in footer or not.

In many open source template like wordpress, PHPBB Forum and MyBB Forum there is a link given in footer that we can't remove. actually i want to implement some thing like wordpress powered by link. if someone using my website script and he try to remove that link then website script shouldn't work properly.

I tried:

<strong>Powered By</strong><a id="poweredby" href="www.mysite.com">My Site Name</a>
<script>
var txt = $("#poweredby").text();
if(txt !="My Site Name" || $("#poweredby") == undefined){
$("body").css("display","none");
}
</script>

above code can easily change or remove. is there any way to protect our template from copying?

Badshah Sahib
  • 184
  • 2
  • 11
  • `jquery` is a bad idea to do this! – Pedram Mar 08 '16 at 13:01
  • I do not understand you problem. If you have developed that page by your own, why don't you just add the html link to the footer of your template? Why is your code above not displayed? What does the results look like? You are welcome to read [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – Peter Mar 08 '16 at 13:05
  • `$("#poweredby")` can never be undefined. Beyond that this question is not clear at all – charlietfl Mar 08 '16 at 13:08
  • @Peter OP already added `html` he want when someone removed the `copyright` text then body get `display: none`. I sure he asked wrong question! – Pedram Mar 08 '16 at 13:08
  • I know it's a bad idea, first if someone going to remove your `copyright`, nodoubt know to get an `inspect element` and remove your `display: none` so easily! second, if someone try to remove copyright text, he can remove/change your `id` , you shoud find a better way to do this. like `server side` way or etc. – Pedram Mar 08 '16 at 13:13

1 Answers1

1

Everybody who can view your site or template can take it and change it. Besides to prohibit the use of your template there is only the way of obfuscation.

This will increase the effort one have make in order to work with you template.

Read the answer to tools for obfuscating html and css.

Community
  • 1
  • 1
Peter
  • 4,752
  • 2
  • 20
  • 32