View Single Post
Old 03-31-2004, 04:58 AM  
Ash@phpFX
Confirmed User
 
Join Date: Nov 2003
Posts: 4,292
you are using the filesize() function, thats not what you are looking for because that returns the size of the file in bytes

try something like this

$num = file_get_contents(file.txt);
$new = $num + 1;
file_put_contents(file.txt, $new);

then your header tag

note: i just made this up on the spot, and im tired, so it might not work properly, icq me 18502614 if it doesnt

also, if you arent running php 5 file_put_contents isnt available, so add this

if (!function_exists("file_put_contents")) {
function file_put_contents($filename,$content) {
if(!$file = fopen($filename, "w+"))
{
return false;
}
if($file)
{
if(!fwrite($file,$content))
{
return false;
}

fclose($file);
}
return true;
}
}


i hope this helps
Ash@phpFX is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote