Hi,
I have a .txt file that contains a variable for a .swf. Since it is to be used in flash it needs to be of the form var1=2, however i wanted to increase the number every time my script is used. At the moment i was using a script like this but of course it doesnt keep the var1= bit in. Can anyone help me out here.
$picsnumber = "variables/picsnumber.txt";
if (file_exists($picsnumber))
{
$fp = fopen($picsnumber,"r+");
$count = fgets($fp,5);
$count += 1;
rewind($fp);
fputs($fp,$count,5);
fclose($fp);
}
else
{
$fp = fopen($picsnumber,"w");
$count = "1";
fputs($fp,$count,5);
fclose($fp);
}
thanks