index.php

This file is a trivial file but necessary nonetheless to give the project a home page. All it does is display a simple welcome message. In a finished application, this would be where you sell the virtues of your site to encourage signups.

Incidentally, seeing as all the MySQL tables have been created and the include files saved, you can now load Example 20-4, index.php, into your browser to get your first peek at the new application. It should look like Figure 20-1.

The main page of the site
Figure 20-1. The main page of the site
Example 20-4. index.php
<?php // index.php
include_once 'rnheader.php';

echo "<h3>Home page</h3>
    Welcome, please Sign up and/or Log in to join in.";
?>

Get Learning PHP, MySQL, and JavaScript 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.