I asked other guys and on their pc it works...
But on my pc it doesn't 😕 😕 😕
<?
if($POST['action'] == "vote") {
$filename = ("../../Polls/polls.txt");
if(file_exists("$filename")) {
if($filehandle = fopen("$filename", "r")) {
$starttime = file("$filename");
$starttime = $starttime[0];
fclose($filehandle);
}
}
$inhoud = ("voting");
$days = ("21");
$mintogo = ($starttime +($days * 86400))-time();
if($mintogo < 0) {
print("The poll is over. A new poll will be inserted soon");
}
$expires = time()+($mintogo);
setcookie("stem", $inhoud, $expires);
$filename2 = ("../../Polls/result.txt");
$result = file("$filename2");
if($filehandle = fopen("$filename2", "w")) {
$res = explode("#", $result[0]);
$cijfer = $POST['poll'];
$cijfer--;
$res[$cijfer]++;
$size = count($res);
$size--;
for($i=0; $i < $size; $i++) {
if($res[$i] != "") {
fputs($filehandle, "$res[$i]#");
}
}
fputs($filehandle, "$res[3]");
fclose($filehandle);
}
header("Location:result.php");
}
elseif($stem == "voting") {
header("Location:result.php");
}
else {
$filename = ("../../Polls/polls.txt");
if(file_exists("$filename")) {
if($filehandle = fopen("$filename", "r")) {
$poll = file("$filename");
fclose($filehandle);
}
}
$question = $poll[1];
$poll1 = $poll[2];
$poll2 = $poll[3];
$poll3 = $poll[4];
$poll4 = $poll[5];
unset ($action);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Poll</title>
</head>
<body bgcolor="#476687">
<center>
<p style="background-color: #476687; border-style: groove; border-color: #000080">
<font face="Trebuchet MS"><? print("$question"); ?></font>
</p>
<form method=POST action="<? echo($PHP_SELF); ?>">
<p style="background-color: #476687; border-style: groove; border-color: #000080">
<input type="hidden" name="action" value="vote">
<table border="0" width="100%">
<tr>
<td width="22%" align="right"><input type="radio" name="poll" value="1"></td>
<td width="130%"><font size="2" face="Trebuchet MS"><? print("$poll1"); ?></font></td>
</tr>
<tr>
<td width="22%" align="right">
<input type="radio" name="poll" value="2"></td>
<td width="130%"><font size="2" face="Trebuchet MS"><? print("$poll2"); ?></font></td>
</tr>
<tr>
<td width="22%" align="right">
<input type="radio" name="poll" value="3"></td>
<td width="130%"><font size="2" face="Trebuchet MS"><? print("$poll3"); ?></font></td>
</tr>
<tr>
<td width="22%" align="right">
<input type="radio" name="poll" value="4"></td>
<td width="130%"><font size="2" face="Trebuchet MS"><? print("$poll4"); ?></font></td>
</tr>
</table><p>
<input type="submit" value="Stem!" style="background-color: #476687">
</form>
</center>
</body>
</html>
<?
}
?>