投票系统防刷代码
$value =$this->host;
if(empty($_COOKIE["cook"])){
setcookie("cook", $value, time()+1800, "/");
$v_host = $this->host;
$v_ip = $this->get_real_ip();
$v_date =date("Y-m-d");
$v_array=explode("-",$v_date);
$v_mad =$v_array[1].$v_array[2];
$v_sql ="Select * from su_votes where v_domain='$v_host' and v_ip='$v_ip' and v_mad='$v_mad'";
$r =mysql_query($v_sql) or die("Error system busy.....plase wait!");
$rs =mysql_fetch_array($r);
if(mysql_num_rows($r)){www.111cn.cn
$qq =mysql_query("Select * from des where v_domain='$v_host' and v_ip='$v_ip' and v_votes if(mysql_num_rows($qq)){
mysql_query("update f set visited=visited+1 where id=$this->u_id");
mysql_query("update g set v_votes=v_votes+1 where v_domain='$v_host' and v_ip='$v_ip' and v_votes } www.111cn.cn
}else{
mysql_query("insert into su_votes(v_domain,v_ip,v_date,v_votes,v_today,v_mad)value('$v_host','$v_ip','$v_date',0,1,'$v_mad')");
mysql_query("update g set visited=visited+1 where id=$this->u_id");
}
} www.111cn.cn
*/
@mysql_query("update g set visited=visited+1 where id=$this->u_id");
}
/*
get real IP
*/
function lock_user_ip(){
$Usql =mysql_query("select * from su_lockip");
$Urs =mysql_fetch_array($Usql);
$UlockIp=$Urs['lockip'];
$ClockIp=$this->get_real_ip();
$Iplist =explode('|',$UlockIp);
if(in_array($ClockIp,$Iplist)){
exit('sorry system lock your IP');
}
}
function get_real_ip(){
$ip=false;
if(!empty($_SERVER["HTTP_CLIENT_IP"])){
$ip = $_SERVER["HTTP_CLIENT_IP"];
}
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR']);
if ($ip) { array_unshift($ips, $ip); $ip = FALSE; }
for ($i = 0; $i if (!eregi ("^(10|172.16|192.168).", $ips[$i])) {
$ip = $ips[$i];
break;
}
}
}
return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);
}

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

WebStorm Mac版
好用的JavaScript开发工具

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

Dreamweaver Mac版
视觉化网页开发工具

禅工作室 13.0.1
功能强大的PHP集成开发环境

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。