PHP-Code:
<?php
require("config.php");
if(isset($_POST["vote"]))
{
if($RateIt == "gesetzt") //cookie abfragen
{
echo "<body>
<p><font face=\"$font\" color=\"$fontcolor\" size=\"$fontsize\">$schonmaltxt</font></p>
<p><font face=\"$font\" size=\"$fontsize\"><a href=\"index.html\">zurück</font></p>";
}
else
{
if($countfile = fopen("datacount.txt","r"))
{
$count = fgets($countfile,1024);
$count ++;
fclose($countfile);
}
if($countfile = fopen("datacount.txt","w"))
{
fwrite ($countfile,"$count");
fclose ($countfile);
}
if($datafile = fopen("datarate.txt","r"))
{
$data = fgets($datafile,1024);
$countold = $count -1;
$datamid = $data * $countold + $Noten;
$dataerg = $datamid / $count;
setcookie("RateIt", "gesetzt", time()+$cookietime); //cookie setzen
fclose($datafile);
}
if($datafile = fopen("datarate.txt","w"))
{
fwrite ($datafile,"$dataerg");
fclose ($datafile);
}
include ("data.inc.php");
}
}
?>
wo habe ich denFehler gemacht? das cookie wird gesetzt nur irgendwie
greift die Sperre nicht.
cu
Kommentar