Any idea why this is not working...

$file = fopen("Counter.txt", "r+");

 $counter = fread($file, filesize("Counter.txt"));
 fwrite($file, "$counter", strlen($counter));

echo '<form name="studVer" action = "ThisSameFile.php" method="post">';


//  Here counter indicates that it has been incremented...
   echo "counter = $counter";

//  For some reason the updated value is not written
//  to Counter.txt
   fwrite($file, "$counter", strlen($counter));

//  Again this indicates that the value of $counter
//  has actually gone up...
   echo "counter = $counter";

I submit here...

The String in Counter.txt is always 0 why is this...

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to