Hi there,
I'm making a news updater that has to be written to a flatfile since flash doesn't read mysql (or at least I don't think it does)
The thing is I have my code working like a champ but it's working backwards.
this
<?php
@extract($_POST);
if(is_writable('news.txt'))
{
$fp = fopen('news.txt','at');
$content = "$start\n\n$dateformat1$date$dateformat2$headerformat1$header$headerformat2$body";
fwrite($fp,stripslashes($content));
fclose($fp);
echo'your changes have been made';
}
else
{
echo'File is not writable';
}
?>
I know "a" adds text to then end of the file and "w" adds it to the begining of the file. But what I need is to add text to the 4th line of the file and move all existing information down to the next line.
I'm a beginner and this code uptop is actually my first php I've ever written so please be gentle.. 🙂