example of what user would post.
Braxton's CheeseIt would appear on the view page as
Braxton\'s Cheese
This is the script that the form uses to process the information
[PHP]<?php
// SQL database Variables
$hostname='';
$user=''; //'user name for MySQL database';
$pass=''; //'Password for database';
$dbase=''; //'database name';
$connection = mysql_connect("$hostname" , "$user" , "$pass") or die ("Cannot connect to database");
$db = mysql_select_db($dbase , $connection) or die ("Cannot select database");
// for register globals off
$name = mysql_escape_string($_POST["name"]);
$email = mysql_escape_string($_POST["email"]);
$sitename = mysql_escape_string($_POST["sitename"]);
$siteurl = mysql_escape_string($_POST["siteurl"]);
$comments = mysql_escape_string(strip_tags($_POST["comments"]));
$ip = $_SERVER["REMOTE_ADDR"];
// This is form.php
$q="INSERT into guestbook (id,name,email,sitename,siteurl,date,ip,comments)
VALUES ('','$name','$email','$sitename','$siteurl',now(), '$ip','$comments')";
$result= mysql_query($q) or die
("Could not execute query : $q." . mysql_error());
if ($result)
{
echo "Thank you, $name. Your entry has been recorded.";
}
?>
<meta http-equiv="refresh" content="3;URL=view-book.php">
<?php include("footer.php"); ?>[/PHP]