That’s all there is to it! Ok I started off by checking if the message was send and if so is it empty with the isset(); function nested in an if command. The isset function checks to see if a variable is set or not if it is it will return true. So I check to see if the variables $_POST[‘name’] and $_POST[‘message’] are set. I use these two variable names because later on in my form I use a form with a method of post and in the form I have two input boxes. One named name and one message.

So I check to see if the variables are set and if they aren’t empty. If all is well then the script proceeds to the code. I start out by getting the current date array then setting it to a readable form with:

This really is all the php that you need except for one more thing a include(“guestbook.html”);. I wrote up a nice little table and everything for the design but you don’t have to. It just makes it look a little better.

Here I make a table for the whole guest book then I create a table for the submit a message form. After this I make a new table for the messages. Then comes the most important part:

PHP Code:

<?php include("guestbook.html"); ?>

This will take the file guestbook.html and insert the code from it into the code of the page that called it. If you remember guestbook.html is where we keep all of the messages. After I include it I end the tables and then Im done!

This guestbook is just a basic foundation that you should use. If you decide to employ this be careful because it is HIGHLY susceptible to XSS attacks.