You can install guestbook at your site using PHP and MySQL. Download the script at the end of this page to learn how to develop a guestbook for your web site. This script uses MySQL database to store the data entered by the visitors. This script uses mysql connecting string to connect to the database, MySql insert query to enter data to the database and MySql select query to get the data from the database. This script has three parts. The first part is the simple form displaying required inputs for the visitors to enter. Name and email address are compulsory and in the second part this form submits data to the add_entry.php page. Here there is a form validation to take care the form entry. We will start with the form
<form method=post action=add_entry.php>
<table border='0' cellspacing='0' cellpadding='0' align=center
width=300>
<tr><td><font face='Verdana' size='2'>Your
Name *</font><td><input
type=text name=name></td></tr>
<tr bgcolor=#f1f1f1><td><font face='Verdana' size='2'>Email
*</font><td><input
type=text name=email></td></tr>
<tr><td><font face='Verdana' size='2'>Country</font><td><input
type=text name=country></td></tr>
<tr bgcolor=#f1f1f1 ><td colspan=2 align=center><textarea
name=dtl rows=5 cols=40></textarea></td></tr>
<tr ><td colspan=2 align=center><input type=submit value='Add
Entry'></td></tr>
</table></form>
This will end the html form part of the guestbook. You can customize the form to suit your design and requirements. You can keep the form in different pages and submit the data to one common php code processing the guestbook data. Now we will learn the PHP code part of the guestbook
Form validation and storing data for the guestbook >>
Download the ZIP file here guest_book.zip
← Subscribe to our YouTube Channel here