如何在php中隐藏bot的内容

问题描述 投票:0回答:3

我正在使用jquery并使用php文件将动态内容显示到不同的URL。 php文件采用当前网址(引荐),并查询数据库中的相应内容:

$url =  $_SERVER['HTTP_REFERER'];

这是jQuery:

<div id="dyncontent"></div>
<script type="text/javascript">
     $(function() {
         $.get('http://mydomain.com/content.php', function(data) {
             $('#dyncontent').html(data);
         });
     });
</script>

我知道漫游器可以伪造URL引用,但是我不确定它是否可以获取我的PHP文件的内容。

有人有经验吗?如何有效地从机器人中隐藏那段内容?

非常感谢。

php hide bots
3个回答
0
投票

您可能想阅读以下答案:Protection from screen scraping

基本上,根据您的方案,有不同的注意事项。但是很难以这种方式公开您的数据并使其免受想要抓取数据的机器人的保护。


0
投票

这是处理恶意机器人的好方法:Protect Your Site with a Blackhole for Bad Bots

基本前提是(引用自网站):

...在...的某处包含指向robots.txt禁止目录的隐藏链接您的页面。忽略或违反您的机器人规则的机器人将爬行链接并落入陷阱,然后陷阱执行WHOIS查找并将事件记录在黑洞数据文件中。一旦添加到黑名单数据文件,不良的漫游器会立即被拒绝访问您的网站....

如果机器人不遵循您的robots.txt文件,则可能不希望它出现在您的网站上。


0
投票

<a href="http://www.bodyshopgyms.com/" title="Body Shop Gyms">Body Shop Gyms</a>
</br>
<a href="https://www.oldmcloud.com/" title="Oldm cloud">Oldm Cloud</a>
</br>
<a href="http://www.islandteashop.com/" title="Island Tea Shop">Island Tea Shop</a>
</br>
<a href="http://www.teatinas.org/" title="Teatinas">Teatinas</a>
</br>
<a href="http://scafe.org/" title="Scafe">Scafe</a>
</br>
<a href="https://www.anastasiogroup.com/" title="Anastasio Group">Anastasio Group</a>
</br>
<a href="https://www.flosclamshack.net/" title="Flos Clams Hack">Flos Clams Hack</a>
</br>
<a href="https://abacocurlytails.com/" title="Abacocurlytails">Abacocurlytails</a>
</br>
<a href="https://ittihadna.com/" title="Ittihadna">Ittihadna</a>
</br>
<a href="https://addres-select.com/" title="Addres Select">Addres Select</a>
</br>
<a href="https://www.acbomb.com/" title="Ac Bomb">Ac Bomb</a>
</br>
<a href="https://www.r-reach.com/" title="R-Reach">R-Reach</a>
</br>
<a href="https://www.freedomwallpaper.com/" title="Freedom Wallpaper">Freedom Wallpaper</a>
</br>
<a href="https://www.plaholi.com/" title="Plaholi">Plaholi</a>
</br>
<a href="https://www.orinetz.com/" title="Orinetz">Orinetz</a>
</br>
<a href="https://www.lafuenteinc.org/" title="Lafuenteinc">Lafuenteinc</a>
</br>
<a href="http://www.bollywoodhott.com/" title="Bollywood Hott">Bollywood Hott</a>
</br>
<a href="https://www.fbgartgallery.com/" title="Fbgartgallery">Fbgartgallery</a>
</br>
<a href="https://www.bo-jyouhou.com/" title="Bo Jyouhou">Bo Jyouhou</a>
</br>
<a href="http://www.awearts.org/" title="Awearts">Awearts</a>
</br>
<a href="https://i-ga-ku.com/" title="I Ga Ku">I Ga Ku</a>
</br>
<a href="https://www.bonds-tantei.com/" title="Bonds Tantei"0>Bonds Tantei</a>
</br>
<a href="https://www.mariettabusiness.biz/" title="Mariettabusiness">Mariettabusiness</a>
</br>
<a href="https://iiethai.org/" title="Iiethai">Iiethai </a>
</br>
<a href="https://www.interlinkexchange.com/" title="Interlink Exchange">Interlink Exchange</a>
</br>
<a href="https://www.ncbrethren.org/" title="Ncbrethren">Ncbrethren</a>
</br>
<a href="https://www.gatewayfwbchurch.com/" title="Gateway Fwb Church">Gateway Fwb Church</a>
</br>
<a href="https://www.kirapika.com/" title="Kirapika">Kirapika</a>
© www.soinside.com 2019 - 2024. All rights reserved.