[摘要]", line_votes); //准备写入投票结果 if (result!=1) //检查IP地址是否重复 file_votes=file(votes, "r&qu... ", $line_votes);
//准备写入投票结果 if ($result!=1)
{ //检查IP地址是否重复 $file_votes=file($votes, "r"); if ($REMOTE_ADDR == $file_votes[1])
{ echo "<center><font color=red>您已投过票了,谢谢您的参与! </font> </center>"; exit; }
//如果IP不重复,则执行以下程序 $ficdest=fopen($votes, "w"); for ($i=0; $i<=count($dataf)-1; $i++)
{ //判断投了那一个栏目 if ($i == $vote)
{ $single_vote[$i]+=1; }
//将数据写回文件 fputs($ficdest, "$single_vote[$i] |