Blame | Last modification | View Log | Download
<body bgcolor="#ff097558">
<?
/* database info, or include a config.php file
a config file would just contain the info from $db_host through the mysql_select_db ... )); */
include('config.php');
/* Set the query and get the last 15 posts, change LIMIT 15 to what ever you want, or just remove it. */
$sql = mysql_query("SELECT * FROM shoutbox ORDER BY id DESC LIMIT 15");
echo "<table>";
while($r=mysql_fetch_array($sql)){
/* this checks to see if the poster had an email address */
if(!$r['email']){ $mail = ""; }else{
$mail = "<a href=mailto:$r[email]></a>";
}
/* this checsk to see if hte user had a website */
if(!$r['site']){ $site = "$r[author]"; }else{
$site = "<a href=$r[site]>$r[author]</a>";
}
/* To modify the way the shouts are displayed, edit this.
date is formated by gmdate() (same as date()), so check php.net to change the way the date's displayed */
echo "<tr>
<td><font face=\"Arial\" color=\"Blue\">
<b>$mail $site</b> ".gmdate("", $r['date'])."
<br>$r[message]
</font>
<hr></td>
</tr>";
}
echo "</table>";
?>
<meta http-equiv="refresh" content="3">