?? emi_vote.php
字號:
<?
/**************************************/
/** 程序:選票統計 **/
/** 文件:emi_vote.php **/
/** 日期:2000/01/25 **/
/** 版本:v1.0 **/
/** 作者:emildy **/
/** 主頁:http://www.e-mi.net **/
/** 請勿刪除此段版權信息 謝謝合作 **/
/**************************************/
$file1="cgi-bin/emi_vote_1_data.txt"; /*選票數據文件*/
$file2="cgi-bin/emi_vote_1_ip.txt"; /*選票IP記錄文件*/
//---------------------------------------------------
$this_ip=getenv("REMOTE_ADDR")."\n";
$fd2=fopen("$file2","r");
$fd_data2=fread($fd2,filesize($file2));
fclose($fd2);
if(!ereg($this_ip,$fd_data2)){
$fd2=fopen("$file2","a");
$fd_write2=fwrite($fd2,$this_ip,strlen($this_ip));
fclose($fd2);
//---------------------------------------------------
$fd1=fopen("$file1","r");
$fd_data1=fread($fd1,filesize($file1));
fclose($fd1);
list($votez_name,$vote1_name,$vote1_counter,$vote2_name,$vote2_counter,$vote3_name,$vote3_counter,$vote4_name,$vote4_counter,$vote5_name,$vote5_counter)=split("\|",$fd_data1);
//---------------------------------------------------
if(!empty($vote)){
if($vote==1 && !empty($vote1_name)){$vote1_counter++;
}elseif($vote==2 && !empty($vote2_name)){$vote2_counter++;
}elseif($vote==3 && !empty($vote3_name)){$vote3_counter++;
}elseif($vote==4 && !empty($vote4_name)){$vote4_counter++;
}elseif($vote==5 && !empty($vote5_name)){$vote5_counter++;
}
$fd_data1="$votez_name|$vote1_name|$vote1_counter|$vote2_name|$vote2_counter|$vote3_name|$vote3_counter|$vote4_name|$vote4_counter|$vote5_name|$vote5_counter";
$fd1=fopen("$file1","w");
$fd_write1=fwrite($fd1,$fd_data1,strlen($fd_data1));
fclose($fd1);
}
}
//---------------------------------------------------
?>
<html><head><meta http-equiv='Refresh' content='0; URL=/'></head>
<body><p>謝謝您對本站的支持,三秒后將自動返回……</p></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -