Now what I need for it is a posting form page (for posting new posts) a news page (for viewing the news) and a delete form page (for deleting any useless posts).
Now I have a postnew.php file which is a simple form with 3 fields and the php script writes those values in the "news.html" file.
Code: Select all
<?php
$from= $_POST['from'];
$title= $_POST['title'];
$content= $_POST['editor_1'];
//filename to write
$filename="news.html";
$handle = fopen($filename, 'a');
fwrite($handle, "<br>FROM <b>$from</b> : <i>$title</i> <br><br>");
fwrite($handle, "$content <br><br>");
echo "<center><a href='news.html'>News updated, click here to view the news page</a>"
?>Now, how can I do it that the news are listed in a page (let's say deletepost.php) using php_include but have a delete button below them that can delete each individual entry?