O lord.. help me...
Posted: Wed Mar 05, 2003 3:56 pm
I'm trying to write news to a file...
I'm trying to format the news using a template... here's the code to show you want I'm trying to do.
I understand PHP can't parse twice, or some such... If this is true, what can I use as an alternative? This is killing me. 
Thanks!
I'm trying to format the news using a template... here's the code to show you want I'm trying to do.
Code: Select all
$fp = fopen("/home/empirega/public_html/xg/news/xgn.txt","w");
if($query) {
while ($data = mysql_fetch_assoc($query)) {
$subject = $data['subject'];
$author = $data['post_by'];
$body = $data['post_body'];
$date = date("l, F j Y \@ g:i a", $data['post_date']);
$news = "<? include('/home/empirega/public_html/xg/news/xgn_template.php'); ?>";
fputs($fp,$news,strlen($news));
fflush($fp);
}
fclose($fp);
}Thanks!