hey guys,
I've created a flash news ticker that's based off an external text file - I'm updating this text file using a PHP script called from a flash file to make it easier for a client to update their ticker...
This is my PHP code
<?php
$filename ="ticker.txt";
$handle= fopen($filename,'a');
$string = "$body";
fputs($handle, $string);
fclose($handle);
Print "_root.status=The data has been sent";
?>
My problem is this: How do I delete the last entry via this script? i.e. This script works but kind of makes a concatamer of my "body" variables when someone hits the submit button and it ends up looking like this:
&body=variableEntry1&body=variableEntry2&body=variableEntry3 etc etc when I only ever want one &body=variableEntryX field listed (the very last one) inplace of the previous ones.
I guess what I'm essentially asking for is a way to clear the old variables in the text file and replace them with the new one.
Cheers,
DJ