douwojiao5919 2013-03-07 20:10
浏览 34

检查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.

  • 写回答

1条回答 默认 最新

  • duanchigeng4313 2013-03-08 07:49
    关注

    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/

    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大