Creating the Home Page

The home page for the site, called index.php, will be a model for the other pages on the public side. It will require the configuration file (for error management) and the header and footer files to create the HTML design. This page will also welcome the user by name, assuming the user is logged in.

To write index.php

1.
Create a new document in your text editor (Script 13.5).
<?php # Script 13.5 - index.php
Script 13.5. The script for the site’s home page, which will greet a logged in user by name.

2.
Include the configuration file, set the page title, and include the HTML header.
require_once ('./includes/config. ...

Get PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.