调查表.htm (用于显示投票页面)
<p><b><font color="#9900FF">调查表--<font face="Arial, Helvetica, sans-serif">SHOW</font></font></b></p>
<p>你觉得本站怎样: </p>
<form name="form1" method=post action='count9.php3' target=_blank >
<input type="radio" name="c1" value="1">
版面布局不好 <br>
<input type="radio" name="c1" value="2">
色彩搭配不好<br>
<input type="radio" name="c1" value="3">
内容太少<br>
<a href="http://www.jollysound.com/_rocky/notebook/notebook.php3" target="_blank">
◎ 以上皆不是 </a><br>
<input type="image" border="0" name="submit" src="../img/btn1.gif" width="49" height="32">
</form>
count9.php3 (用于计算票数)
<?
$countfile="count9.txt";
$lines=file($countfile);
for ($i=0;$i<count($lines);$i++)
{
list($id,$url,$count)=explode("|",$lines[$i]);
if ($id==$c1)
{$count=$count+1;
$lines[$i]=$id."|".$url."|".$count."\n";
break;
}
}
$fp=fopen($countfile,"w");
for ($i=0;$i<count($lines);$i++)
fputs($fp,$lines[$i]);
fclose($fp);
header("location: $url");
?>
showdiaocha.php3 (用于显示调查结果)
<?
$countfile="count9.txt";
$lines=file($countfile);
for ($i=0;$i<count($lines);$i++)
{
list($id,$url,$count)=explode("|",$lines[$i]);
$cc[$id]=$count;
}
echo "<p>调查结果:</p><p> 版面布局不好: $cc[1]</p><p> 色彩搭配不好: $cc[2]</p><p> 内容太少: $cc[3]</p>";
?>
count9.txt (用于记录调查结果)
1|showdiaocha.php3|0
2|showdiaocha.php3|0
3|showdiaocha.php3|0
|