Page 2 of 2

Posted: Sat Nov 29, 2003 6:59 am
by mchaggis
Yes line 19 is:

Code: Select all

fwrite($fp, join('',$oldnews);
Spot the deliberate mistake lol.... Always do this... yup I'v missed of a bracket:

Code: Select all

fwrite($fp, join('',$oldnews));

Posted: Mon Dec 01, 2003 10:53 pm
by dull1554
it's printing Array to the text file after every news entry

Posted: Tue Dec 02, 2003 12:54 am
by mathewvp
Try this

Code: Select all

<?php 
if((!isset($_POST&#1111;'subject'])) or (!isset($_POST&#1111;'news']))) 
&#123; 
     echo 'You must enter <b>ALL</b> fields before you can continue!'; 
     exit; 
&#125; 
$subject = $_POST&#1111;'subject']; 
$news = $_POST&#1111;'news']; 
$time = date("D d of F, h:i a"); 

$oldnews = implode('',file("news.txt"));

$fp = fopen("news.txt", "w"); 
$insertcode = "<table width='100%' border='0' cellspacing='1' cellpadding='2' bgcolor='#dcdcdc' align='center'><tr><td width='100%' border='1' bgcolor='whitesmoke'>".$subject." - ".$time."</td></tr><tr><td width='100%' border='1' bgcolor='#ffffff'>".$news."</td></tr></table><br>"; 


fwrite($fp, $insertcode); 
fwrite($fp,$oldnews); 
fclose($fp); 
?>

Posted: Tue Dec 02, 2003 9:31 am
by dull1554
thanks man, i love this place, it works perfectly