php prepending
php prepending
- Started
- Last post
- 2 Responses
- oculasm
anyone have any experience with writing contents of a post operation to the beggining of an existing text file in php?
Im having no joy with my attempt below. looked up manuals and saught help on other forums, maybe a php whizz can help here.
<?php
@extract($_POST);
if(is_writable('news.txt'))
{
$fp = fopen('news.txt','a+');fseek($fp, 0, SEEK_SET);
//fwrite($fp,$content);
fputs ($fp, "
$entrydate
$entrymsg");
fclose($fp);
echo'Successfully written entry';
}
else
{
echo'File is not writable';
}
?>
- oculasm0
found the answer..
- protoculture0
http://www.php.net/manual/en/ is your friend.