i found this code, the only problem it's it block out user that using firewall that doesn't send out third party cookies such as zone alarm (have to turn it off)
can someone help
Code:
session_start();
$UR_DOMAIN1 = 'www.google.com';
$UR_DOMAIN2 = 'http://google.com';
$TEN_COOKIE = 'firewall';
if ( strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot')||strstr($HTTP_SERVER_VARS
['HTTP_USER_AGENT'] ,'msnbot')||strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'slurp'))
{}
else{
if( file_exists($firewall) ){ require_once($firewall);}
if((strpos($_SERVER['HTTP_REFERER'], $UR_DOMAIN1) !== 0)) {
if (empty($HTTP_SESSION_VARS['{$TEN_COOKIE}']))
{
if (!empty($HTTP_POST_VARS['{$TEN_COOKIE}']))
{
session_register('{$TEN_COOKIE}');
$HTTP_SESSION_VARS['{$TEN_COOKIE}']='myforum_protection';
header("location: ".$_SERVER['REQUEST_URI']);
exit();
}
if((strpos($_SERVER['HTTP_REFERER'], $UR_DOMAIN2) !== 0)) {
if (empty($HTTP_SESSION_VARS['{$TEN_COOKIE}']))
{
if (!empty($HTTP_POST_VARS['{$TEN_COOKIE}']))
{
session_register('{$TEN_COOKIE}');
$HTTP_SESSION_VARS['{$TEN_COOKIE}']='myforum_protection';
header("location: ".$_SERVER['REQUEST_URI']);
exit();
}
$sform='
HTML CONTENT GO HERE
';
echo $sform;
exit();
}
}
}
}
}
Bookmarks