Create a new PHP document called add.php. On this page create
a form which can be used to type the news. The Form I have
showed as an example is only set for Title, News, Poster, and
Submit. If your expeirenced you can modify the fields, but
remember if you modify the form you must also modify the php.
News:<TEXTAREA WRAP=VIRTUAL NAME="news"
COLS=20 ROWS=5> Nice Site! </TEXTAREA><br>
Posted by:<INPUT TYPE="text"
Create a new page called added.php which will be
telling the form what to do.
$da = getdate();
$date="$da[weekday] $da[mday] $da[month] $da[year]";
$news = ("<font size=\"2\"
<b>$title</b> //form text box named title
$news //form text box named news (get it?)
Posted by: <b>$posted</b> On the $date
$file = fopen("news.php", "r");
$read = fread($file, filesize("news.php"));
$blah = fopen("news.php", "w");
//Leave alone look and learn, only edit if you know
fwrite($blah, "$news $read");
print "<meta http-equiv=\"refresh\"
//edit path to where the news.php file falls
Make a new file called news.php
To make the news appear on your page just use php incldue by
inserting the following code anywhere on anypage.
<? include "news.php";?>
I also suggest putting a login over the add page so people
cant add news your site without logging in first. If your not
sure how to make a login, I have created a User Authentication
Tutorial also available in the php category.
NOTE: Make sure all files are chmodded to 777.
Tutorial By Xtasy