Specifications

You will then be prompted to type in your password.
With the database set up, lets go on and implement the basic site.
Implementing the Basic Site
The first page well build will be called login.php because it provides users with the opportu-
nity to log in to the system. The code for this first page is shown in Listing 24.2.
LISTING 24.2 ogin.phpFront Page of the PHPBookmark System
<?
require_once(“bookmark_fns.php”);
do_html_header(“”);
display_site_info();
display_login_form();
do_html_footer();
?>
This code looks very simple, as it is mostly calling functions from the function API that we
will construct for this application. Well look at the details of these functions in a minute. Just
looking at this file, we can see that we are including a file (containing the functions) and then
calling some functions to render an HTML header, display some content, and render an HTML
footer.
The output from this script is shown in Figure 24.3.
The functions for the system are all included in the file bookmark_fns.php, shown in Listing
24.3.
LISTING 24.3 bookmark_fns.phpInclude File of Functions for the Bookmark Application
<?
// We can include this file in all our files
// this way, every file will contain all our functions
require_once(“data_valid_fns.php”);
require_once(“db_fns.php”);
require_once(“user_auth_fns.php”);
require_once(“output_fns.php”);
require_once(“url_fns.php”);
?>
Building Practical PHP and MySQL Projects
P
ART V
504
30 7842 ch24 3/6/01 3:34 PM Page 504