ich hab hier ein textcounter gebaut mit cookie, aber das cookie funzt irgendwie ned... hab keine ahnung warum, irgandwas ist ned ok
könnt ihr mir helfen?
Code
		
					
				<?
  $datei = fopen("counter.txt","r+");
  $counterstand = fgets($datei, 10);
  if($_COOKIE["altermatt"] == "mal") 
	{
	echo $counterstand;
	}
	else
	{
if($counterstand == "")
    {
    $counterstand = 0;
    }
  $counterstand++;
  echo $counterstand;
  rewind($datei);
  fwrite($datei, $counterstand);
  fclose($datei);
setcookie("altermatt","mal",time()+(3600*24*14),"/");
  }
   ?>
	
			Alles anzeigen
	und ohne cookie
Code
		
					
				<?
  $datei = fopen("counter.txt","r+");
  $counterstand = fgets($datei, 10);
if($counterstand == "")
    {
    $counterstand = 0;
    }
  $counterstand++;
  echo $counterstand;
  rewind($datei);
  fwrite($datei, $counterstand);
  fclose($datei);
   ?>
	
			Alles anzeigen
	danke quadro