Using PHP to design aGuestbook Website Tutorial By: Joaquin Coston
Step 1 First, you will need to make an index.php file. On this page you will include a header for our guestbook, the mainContent, which is making a section for the person name to sign, and footer dividers for the bottom of your page.
Step 2 Second, you will need to make a CSS style sheet to design our page any way you like. This is the step where you give your page color, boxes, borders, or anything else to make your page look presentable.
Step 3 Next, you will need to make a header.php file. On this file you will put all your HTML code for the header divider and or also include a graphic banner of your choice if you want it on your page.
Step 4 After that you will now create a footer.php file and then put all your HTML code in this file that you want shown on your page. This is most likely the spot where you will put your copyrights at or who the site was made by.
Step 5 Now use <?php include"header.php"; ?> and <?php include"footer.php"; ?> in the appropriate places on the index.php. The header will go at the top and the footer at the bottom.
Step 6 Next take the chance to see if your page is looking the way you want so far. If not go back and switch things around until you get it to the way you desire.
Step 7 After that, copy your index.php into your guestbook.php
Step 8 On the index.php, Create a form in the mainContent divider with 2 text boxes: one for firstname and one for lastname. Set the form action to guestbook.php
Step 9 Then once you do this check the form you made on your page for the index.php to make sure it goes through the guestbook.php when a person signs its name to it.
Step 10 Now the next step is to make sure your site is reading the data inputted, so now we have to edited the guestbook.php and make sure we use $_POST["inputname"] so we can observe the data the person has entered.
Step 11 Then finally we will use this thing called the echo function to print out a statement once the person has signed in. The function is $fname = $_POST["fname"]; echo $fname; and we will also put this in the guestbook.php. Then the statement we can have it say afterwards is “Welcome, firstname lastname! You have signed the guestbook.”
Step 12 And Now you have you Guestbook site using PHP.