Hello, I'm new on this board and kinda new in PHP but I'm learning, I have got this piece of code now in a file called "counter.php" :
<?php
$datum = date("\admY");
$filename = "datum.txt";
$date = $datum;
$fp = fopen( $filename,"r");
$Old = fread($fp, 100);
fclose( $fp );
$Old = split ("=", $Old, 5);
$NewCount = $Old[1] + '1';
$New = "$date=$NewCount";
$fp = fopen( $filename,"w+");
if (flock($fp, 2)) {
fwrite($fp, $New, 100); }
fclose( $fp );
print "$date=$NewCount";
?>
This is an old php script I got somewhere what I just modified a bit to get the time in it. This now works. It makes a datum.txt file and in this file it adds
a30082004=01
. But now my problem; how can I let the script make another line when you look at the file tomorrow? So that the datum.txt files contains this:
a30082004=47
a31082004=56
a01092004=24
etc.
And do you guys see other things that I should have done another way, because I still have errors on some servers and on other servers I don't have any error!?
Could somebody please help me out?
Kai-Hugo
PS. the "a" in "a30082004=47" is for a thing in my flash script.