I'm trying to re-create my fire department's website, as it's strictly a HTML website, and far from professional. Everything is going excellently, including the log in system and pave navigation. However, I've run into a slight bump in the road that might be beyond my current skill level:
How do I have the person who's logged into the admin panel, enter information in a blog-like style, to post it to the front page (such as a news post / website announcement)?
It's actually a lot like this post here - Editor tools at the top, and when it posts, it has the formatting and breaklines. When I put it in my database, it shows up as one clump wall of text, with no formatting.
INDEX.PHP
<?
$qnews = mysqli_query($link, "SELECT * FROM news WHERE archive = 0 ORDER BY time DESC");
while($rownews = mysqli_fetch_array($qnews))
{
if(empty($rownews))
{
echo "<div class=\"news\"><h2>There are no announcements posted.</h2></div>";
}
else
{
echo "<div class=\"news\">";
echo "<h2>";
echo $rownews['title'];
echo "</h2><p>";
echo $rownews['body'];
echo "</p><br />";
echo "<span class=\"newsfooter\">Posted on <font color=\"#FA0000\">";
echo date("F d Y @ H:i", strtotime($rownews['time']));
echo "</font> by <font color=\"#0000FA\">";
echo $rownews['creator'];
echo "</font></span></div>";
}
}?>
MySQL Table
news
-- id (A_I) (UNIQUE)
-- title VARCHAR(50)
-- body VARCHAR(5000)
-- created DATETIME(25) Default:CURRENT_TIMESTAMP
-- edited DATETIME(25)
-- archived INT(1) Default:0
Am I way out of my league, or can someone point me in the right direction?