Coding a simple Guestbook using PHP and MySQL By http://www.vinuthomas.com. This is a short article which shows you how to make a simple guestbook by capturing the visitor's input and storing the data in a database using PHP. You'll need to know a bit of HTML, PHP and MySQL in order to do the task. For a guestbook to work, we'll need to create 3 pages. We'll need a form to prompt the visitor to leave a comment in your guestbook. Let's call this page comments.php . We'll need to create some PHP and MySQL code to capture the visitor's input and save it to the database. Let's call this page, store_comment.php. Finally, we need to show the comments the visitors have submitted as our guest book. This page will be called guestbook.php since this will be our main guestbook page. Get the Visitor's Details and Comments ( comments.php) Let's start off by making a sample form with the data to be captured using HTML. We'll begin by listing out the data we wish to capture. A general guestbook captures the following data : Visitors Name Email Id Comment and Country Let's make the simple guestbook form in HTML to look like the following submission box: Your Name Your Email ID Country Comments This form should submit the data to the second part of our code which will be saved in store_comment.php . So the action of the form should be targeted at save_db.php. The simple HTML code for the form would look like this :