Modifying the Template


Since all of the pages in this and the following chapter will be part of the same Web application, it'll be worthwhile to use a common template system. Instead of creating a new template from scratch, the layout from Chapter 3, "Creating Dynamic Web Sites," will be used again, with only a minor modification to the header file's navigation links.

To make the header file

1.

Open header.html (Script 3.2) in your text editor.

2.

Change the list of links to read (Script 7.1)

 <li ><a href="index.  php title="Go to the Home  Page>Home</a></li> <li><a href="register.php" title=  "Register>Register</a></li> <li><a href="view_users.php"  title="View the Existing  Users>View Users</a></li> <li><a href="password.php" title=  "Change Your Password>Change  Password</a></li> 

Script 7.1. The site's header file has been modified with new navigation links.


All of the examples in this chapter will involve the registration, view users, and change password pages. The dateform and calculator links from Chapter 3 can be deleted.

3.

Save the file as header.html.

4.

Upload the new header file to your Web server, placing it into the includes directory along with footer.html (Script 3.3) and layout.css (available for download from the book's supporting Web site).

5.

Test the new header file by running index.php in your Web browser (Figure 7.1).

Figure 7.1. The dynamically generated home page.


Tips

  • For a preview of this site's structure, see the "Organizing Your Documents" sidebar in the next section.

  • Remember that you can use any file extension for your template files, including .inc or .php.

  • To refresh your memory on the template-creation process or the specifics of this layout, see the first few pages of Chapter 3.




    PHP and MySQL for Dynamic Web Sites. Visual QuickPro Guide
    PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    ISBN: 0321336577
    EAN: 2147483647
    Year: 2005
    Pages: 166
    Authors: Larry Ullman

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net