#native_company# #native_desc#
#native_cta#

Comments Form

By Brian Engelhardt
on September 5, 2005

Version: 1.0

Type: Full Script

Category: HTML

License: GNU General Public License

Description: A simple Comments submission and reading system. Allows for protection of comments keeping them hidden to anyone who doesn’t know the username and password.

<html>
<head>
<title>View Comments</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
Echo ("Loading and outputting comments collection...<br />");
$username="YourUseraName";
$password="Yourpassword";
$filename = "yourCommentsFile.txt";
if ($_POST["username"]!=$username || $_POST["password"]!=$password)
{
?>
The username or password is incorrect.<br>
<a href = "view.html">Click here to go back.</a>
<?php
exit();
}
$fd = fopen ($filename, "r");
while (!feof ($fd)) {
    $buffer = fgets($fd, 4096);
    echo $buffer . "<br />";
}
fclose($fd);
echo "<br />End of file<br /><br />";
?>
<a href = "delete.php">Click here to clear the file.</a><br>
<a href = "/">HOME</a>
</body>
</html>