Are you using a database to store the records? If so, here's an example of adding a comment section to a page with the PHP for retrieving all stored comments to display, then a section to allow the user to enter comments, then the PHP file used to send the user's comments to the database (tested on my own page and it works):
DISPLAY ALL COMMENTS FROM A DATABASE:
$username="dbo123456";
$password="password";
$database="db654321";
$localhost="db123.whatever.net";
mysql_connect($localhost,$username,$password);
mysql_select_db($database) or die( "Unable to reach database");
$query="SELECT * FROM tablename";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
// echo "
Comments";
$i=0;
while ($i < $num) {
$Name=mysql_result($result,$i,"Name");
$IP=mysql_result($result,$i,"IP");
$Comment=mysql_result($result,$i,"Comment");
echo "
$Name $IP
$Comment
";
$i++;
}
?>
ALLOW USER TO ENTER COMMENTS:
// THE PHP FOR ADDING THE NEW COMMENT
$Name = $_POST['Name'];
$IP = $_SERVER['REMOTE_ADDR'];
$Comment = $_POST['Comment'];
$database = "db654321";
$localhost = "db123.whatever.net";
$username = "dbo123456";
$password = "password";
mysql_connect($localhost, $username, $password);
mysql_select_db($database) or die("Unable to reach database");
$query = "INSERT INTO tablename VALUES
('$Name', '$IP', '$Comment')";
$result = mysql_query($query);
print "
";
mysql_close();
?>
EDIT: Are you quite sure you know what you're talking about?