I have plans to write an unique PHP news script without using a database. I need to figure a way to allow comments.
++ Plans ++
addnews.php
I will be able to add News Title, Short Description, and News body. After I submit the news data, I want it to INSERT into a news.db file in this format:
["News ID", "News Title", "Brief Description", "News Body", "Date", "Author"]
So an example would be:
["1", "Site has launched!", "Get the scoop on the site launch!", "The body of the news will go here and it will allow html but not php. I could go on forever in the body but will it mess up the news.db?", "January 15, 2004", "Ps2gamer"]
Each news would be in a [].
viewnews.php
I want to be able to read the news that is in the news.db. And on the page I want it to show in this format:
<a href="shownews.php?id=(News ID)">(News Title)</a><br>(Brief Description)<br>Posted On: (Date) by: (Author)<br><br>
shownews.php
Pritty much the same format as viewnews.php except instead of Brief Description it would be the full body and shownews.php will only show 1 news item and it gets it from the URL (shownews.php?id=1). I alos would need to have a comment link {eg. comments.php?id=(News ID)}
addcomments.php
I need for people to add comments for a paticular news item and have it store it into comments.db using this format:
["News ID", "Comment ID", "Comment Title", "Comment Body", "Date", "Author", "Email"]
comments.php
I need for people to view all the comments underneath the actualy body of the news body (in the same format as shownews.php). But like this underneath everything:
[CODE]
Posted on: (Date) by: <a href="(Email)">(Author)</a><br>
(Comment Body)<br>
[/CODE]
editnews.php + deletenews.php
I also need to be able to edit each and every news item, including ID,title, body and date. And of course if I can edit it, then I will need to be able to delete them. I also need to be able to edit and delete comments according to News ID or Comment ID.
I am an ok php programmer, but I am not familar with file stuff, So if anyone can lead me into the right direction about how I can accomplish this that would be great.