检查Javascript / PHP小部件中的链接

I created my own Javascript/PHP widget that takes info from my site, and allows other users to put it on their own. I'd like to know how I can put in some "Link Protection". The reason I made the widget is so that I can gain some valuable links from those who decide to use my widget on their site. The site I got the tutorial from is

http://php-drops.blogspot.ca/2011/04/creating-widget-with-javascript-and-php.html

When I look at the source code, the link to the site is not visible since it is being brought up in an iframe. What I wanted to do is to put a separate <div> that will have something like

<div id="my_copyright">Data provided by <a href="http://www.example.com">Example.com</a></div>

How would I go about protecting the data so that if the user tries to remove the link, alter the <a> tag to a rel="nofollow" or any other "work arounds", the data will not load and post an alert() and not load the data?

Any help would be great! The script currently uses 1 JS file 1 PHP file that extracts data from MySQL and prints out the data needed.

dongluo8439
dongluo8439 如果您将其作为源代码分发,并且它不需要您的服务器,他们可以只取出跟踪代码。你可以缩小它,这样他们很难找到要修改的代码。
7 年多之前 回复
douwo8140
douwo8140 那么我无法保护我的代码吗?或者可能跟踪和阻止谁在改变代码?
7 年多之前 回复
dongshi3818
dongshi3818 你不能可靠地做到这一点。有人可以删除检查是否已被修改的代码。
7 年多之前 回复

1个回答



正如Barmar建议的那样,你唯一的选择是通过默默无闻的安全性。 这取决于您的受众。 对于一个随意的网站管理员来说,它可能会阻止他查找代码。 它只会增加“不能被诅咒”的因素。</ p>

1)缩小你的代码: http://fmarcia.info/jsmin/test.html </ p>

2)使用JS packer / obfuscator: http://dean.edwards.name/packer/ </ p>
</ div>

展开原文

原文

As Barmar suggested, your only option is security through obscurity. The success of this depends on your audience. For a casual webmaster, it might deter him from chaning your code. It just increases the "can't be arsed" factor.

1) Minify your code : http://fmarcia.info/jsmin/test.html

2) Use a JS packer/obfuscator : http://dean.edwards.name/packer/

dongxing9219
dongxing9219 我实际上更好奇我如何放入HTML链接并让它如果他们试图删除或改变链接,那么他们将得到一个错误。 例如,如果他们被给予这样的东西来复制并粘贴到他们的网站,那么如果他们试图删除<a href="myurl.com">我的锚文本</a>,那么它将不会解析。 这是我可以复制和粘贴的JS代码。 <div id =“wd_id”> </ div> <script type =“text / javascript”src =“example.com/script.js”> </ script> <script type =“text / javascript”> init_widget(300,300 ,“all”,“current”,“TITLE”)</ script> <a href="www.example.com"> MyAnchor </a>
7 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问