Easy PHP Guestbook Part 3 – The Form
In Part 3 of the Easy PHP Guestbook tutorial we will cover creating the user submission form for our guestbook.
Create a new file and call it guestbookform.php and put the following code in it:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF8″ />
<title>My Guestbook</title>
</head><body>
<form action=”" method=”post”>
<label>Name
<input type=”text” name=”guestbookname” id=”guestbookname” />
</label>
<br />
<label>Website
<input type=”text” name=”guestbookwebsite” id=”guestbookwebsite” />
</label>
<br />
<label>Entry
<textarea name=”guestbookentry” id=”guestbookentry” cols=”45″ rows=”5″></textarea>
</label>
<br />
<label>
<input type=”submit” name=”submit” id=”submit” value=”Submit” />
</label>
</form>
</body>
Save the file and upload it to your guestbook folder that you created on the server from the previous tutorial. You can point your browser to http://yourservername.com/guestbook/guestbookform.php
You should see the form with a spot to write a name, website and an entry, as well as a submit button. This file as it is now will not perform any functions, in part 4 we will cover how to take the values that a user would fill in and store them in the database.
This concludes Part 3 of the tutorial.















