<?php
$HTTP_REFERER = $_SERVER[“HTTP_REFERER”];
$HTTP_USER_AGENT = $_SERVER[“HTTP_USER_AGENT”];
$SERVER_NAME = $_SERVER[“SERVER_NAME”];
$CompCharArr = explode(“,”,”Baiduspider,Scooter,ia_archiver,Googlebot,FAST-WebCrawler,MSNBOT,Slurp”);
$CompCharArrSize = sizeof($CompCharArr);
$CheckSign = “”;
for($i=0;$i<$CompCharArrSize;$i++)
{
$ComChar = trim($CompCharArr[$i]);
if($CompChar<>”” && eregi($CompChar,$HTTP_USER_AGENT))
{
$CheckSign = “T”;
}
}
$SERVER_NAME_M = “http://”.$SERVER_NAME;//strlen
$EndLenth = strlen($SERVER_NAME_M) + 1;
$CompServerName = “http://”.$SERVER_NAME.”/”;
if(empty($CheckSign) && ($HTTP_REFERER == “” or substr($HTTP_REFERER,0,$EndLenth) <> $CompServerName ))
{
?>
<html>
<body>
<form action=” name=checkrefer id=checkrefer method=post></form>
<script>
document.all.checkrefer.action=document.URL;
document.all.checkrefer.submit();</script>
</body></html>
<?php }?>
WooCommerce 条件判断函数 wordpress is_shop
所有的条件判断函数测试当前条件是否匹配,匹配返回 TRUE,不匹配则返 阅读更多…