note 15883 rejected from function.fopen by jimw

From: Date: Sat, 06 Oct 2001 18:15:01 +0000
Subject: note 15883 rejected from function.fopen by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-18646@lists.php.net to get a copy of this message
how can i make my script to put the text at the beginning of my txt file without deleting the file ? so what do i have to do ? cause "aw" does not work <?php if($action == add){ $fp = fopen("news.txt", "a+"); $data = "<tr><td><img src=\"symbole/$bild.gif\">&nbsp;<font color=\"#F6A800\" size=+1><b>$title </b></font><br><font color=\"#777777\" size=\"-2\">postet by <a href=\"mailto:$mail\">$name</a> </font></td></tr><tr><td> $news <br><hr bordercolor=black width=100% align=center><font size=\"-2\"><a href=$cid.php4>(Kommentare)</a></td></tr>\n"; fputs($fp, $data); fclose($fp); echo"News added! <a href=index.php4>>>back</a>"; } else{ echo"<form action=$PHP_SELF?action=add method=post><br>"; echo"Gelber Titel<br>"; echo"<input type=text name=title value=TITEL><br>"; echo"Name<br>"; echo"<input type=text name=name value=Name><br>"; echo"Vollständige Mailadresse<br>"; echo"<input type=text name=mail value=flok@chello.at><br>"; echo"Kommentar ID (bitte leer lassen)<br>"; echo"<input type=text name=cid value=comments1><br>"; echo"<textarea rows=5 cols=40 name=news wrap=VIRTUAL>Text</textarea><br>"; echo"<input type=submit name=submit value=Abschicken><br><br>"; } ?>

« previous php.notes (#18646) next »