Location: PHPKode > projects > Simple Comments > comments/admin/index.php
<? require("header.php"); ?>
<p align="center">
<a href="../addcomment.php">Add Comment</a><br><br>
<a href="bannedips.php">Banned IPs</a><br><br><hr>
<?
require_once( '../config.php' );
mysql_connect($dbaddress,$dbuser,$dbpass);
@mysql_select_db($dbname) or die( "Unable to select database");
$query="SELECT * FROM comments";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();

$i=0;
while ($i < $num) {

$id=mysql_result($result,$i,"id");
$name=mysql_result($result,$i,"name");
$email=mysql_result($result,$i,"email");
$timedate=mysql_result($result,$i,"timedate");
$message=mysql_result($result,$i,"message");
$ip=mysql_result($result,$i,"ip");
?>
<p align="center">
<?
echo "<b>Name: $name</b><br>Date/Time Posted: $timedate<br>Email: $email<br>IP: $ip";
?>
 - <a href="banip.php?ip=<? echo $ip; ?>">Ban IP</a>
<?
echo "<br><br>Message:<br>$message<br>";
?>
<br><br>
<a href="deletecomment.php?id=<? echo $id; ?>">Delete</a>
<?
echo "<br><hr>";

$i++;
}



?>
<p align="center">
<a href="bannedips.php">Banned IPs</a><br><br>
<a href="../addcomment.php">Add Comment</a><br><br>
<a href="../">Exit Admin</a>
Return current item: Simple Comments