ey iedereen
ik heb een poll gescript. Ik dacht dat alles klopte maar ik kreeg een error. Ik snap niet wat ik fout heb zien jullie het wel?

dit krijg ik na 1 keer stemmen

error:
Parse error: parse error, unexpected ';', expecting '(' in /home/no1animes.nl/harm/testshit/log/poll_log.php on line 2

script:
<?

$VRAAG = "Doet ie het?";
$ANTWOORDEN = array ('Goed','Slecht');
$HOEVEELANTWOORDEN = count($ANTWOORDEN);
$LOGBESTAND = "log/poll_log.php";


$ipadres = $REMOTE_ADDR;

include("$LOGBESTAND");

$aantal = count ($ips);
$watnu = "stemmen";
for ($tel = 0; $tel < $aantal; $tel++){
if ($ipadres == $ips[$tel]){
$watnu = "";
}
}

if($watnu == "stemmen"){
// stem shit
if (!$vote) {
echo "<FORM METHOD=\"POST\">\n";
echo "$VRAAG<br><br>\n";
for ($a = 0; $a < $HOEVEELANTWOORDEN; $a++){
echo "<INPUT TYPE=\"radio\" NAME=\"answer\" VALUE=\"$a\"> $ANTWOORDEN[$a]<br>\n";
}
echo "<br><INPUT TYPE=\"Submit\" NAME=\"vote\" VALUE=\"Stem\">\n";
echo "</FORM>";
} else {
$ipadres = $REMOTE_ADDR;
include("$LOGBESTAND");

$aantal = count ($ips);
$watnunouweer = "nognietgestemd";
for ($tel = 0; $tel < $aantal ; $tel++){
if ($ipadres == $ips[$tel]){
$watnunouweer = "";
}
}
if ($watnunouweer == "nognietgestemd"){
for ($b = 0; $b < $HOEVEELANTWOORDEN; $b++){
if ($b == $answer){
$bijnalogantwoorden[$b] = $logantwoorden[$b]+1;
} else {
$bijnalogantwoorden[$b] = $logantwoorden[$b];
}
}
$newips = array_push($ips, "$ipadres");
$fp = fopen("$LOGBESTAND","w");
fputs($fp, "<?\n\$logantwoorden = $bijnalogantwoorden;\n\$ips = $newips;\n?>");
fclose($fp);

include("$LOGBESTAND");
echo "<TABLE cellSpacing=0 cellPadding=0 border=1>\n";
echo "<tr>\n<th>Keuzes</th>\n<th>Percentage</th>\n<th>Aantal stemmen</th>\n</tr>\n";

for ($abc = 0; $abc < $HOEVEELANTWOORDEN; $abc++){
$totaal = $totaal+$logantwoorden[$abc];
}

for ($c = 0; $c < $HOEVEELANTWOORDEN; $c++){
$procent = $logantwoorden[$c] * 100 / $totaal;
$procent_print = number_format($procent, 1);
$procent_img = floor($procent);
echo "<tr>\n<td> $ANTWOORDEN[$c] </td>\n<td><img height=16 src=\"$IMG_DIR_URL/vote_left.gif\"><img height=16 width=\"$procent_img\" src=\"$IMG_DIR_URL/vote_middle.gif\"><img height=16 src=\"$IMG_DIR_URL/vote_right.gif\"> $procent_print % </td>\n<td> $logantwoorden[$c] </td>\n</tr>\n";
}
echo "<tr>\n<td> Totaal: </td>\n<td> </td>\n<td> $totaal </td>\n</tr>\n";
echo "</TABLE><br>";
} else {
include("$LOGBESTAND");
echo "<TABLE cellSpacing=0 cellPadding=0 border=1>\n";
echo "<tr>\n<th>Keuzes</th>\n<th>Percentage</th>\n<th>Aantal stemmen</th>\n</tr>\n";

for ($abc = 0; $abc < $HOEVEELANTWOORDEN; $abc++){
$totaal = $totaal+$logantwoorden[$abc];
}

for ($c = 0; $c < $HOEVEELANTWOORDEN; $c++){
$procent = $logantwoorden[$c] * 100 / $totaal;
$procent_print = number_format($procent, 1);
$procent_img = floor($procent);
echo "<tr>\n<td> $ANTWOORDEN[$c] </td>\n<td><img height=16 src=\"$IMG_DIR_URL/vote_left.gif\"><img height=16 width=\"$procent_img\" src=\"$IMG_DIR_URL/vote_middle.gif\"><img height=16 src=\"$IMG_DIR_URL/vote_right.gif\"> $procent_print % </td>\n<td> $logantwoorden[$c] </td>\n</tr>\n";
}
echo "<tr>\n<td> Totaal: </td>\n<td> </td>\n<td> $totaal </td>\n</tr>\n";
echo "</TABLE><br>";
}
}
} else {
// resultaten
include("$LOGBESTAND");
echo "<TABLE cellSpacing=0 cellPadding=0 border=1>\n";
echo "<tr>\n<th>Keuzes</th>\n<th>Percentage</th>\n<th>Aantal stemmen</th>\n</tr>\n";

for ($abc = 0; $abc < $HOEVEELANTWOORDEN; $abc++){
$totaal = $totaal+$logantwoorden[$abc];
}

for ($c = 0; $c < $HOEVEELANTWOORDEN; $c++){
$procent = $logantwoorden[$c] * 100 / $totaal;
$procent_print = number_format($procent, 1);
$procent_img = floor($procent);
echo "<tr>\n<td> $ANTWOORDEN[$c] </td>\n<td><img height=16 src=\"$IMG_DIR_URL/vote_left.gif\"><img height=16 width=\"$procent_img\" src=\"$IMG_DIR_URL/vote_middle.gif\"><img height=16 src=\"$IMG_DIR_URL/vote_right.gif\"> $procent_print % </td>\n<td> $logantwoorden[$c] </td>\n</tr>\n";
}
echo "<tr>\n<td> Totaal: </td>\n<td> </td>\n<td> $totaal </td>\n</tr>\n";
echo "</TABLE><br>";
}
?>

alvast bedankt

mzzls Harm
Jij include log/poll_log.php in dit script en de error geeft aan dat DAAR de fout in zit.

Reageren