Specifications
FIGURE 27.3
After successful login, the user can begin using the application.
On this execution of the script, we will activate different sections of code. The login form has
two fields, $username and $password. If these have been filled in, the following segment of
preprocessing code will be activated:
if($username||$password)
{
if(login($username, $passwd))
{
$status .= “<p>Logged in successfully.<br><br><br><br><br><br>”;
$auth_user = $username;
session_register(“auth_user”);
}
else
{
$status .= “<p>Sorry, we could not log you in with that
username and password.<br><br><br><br><br><br>”;
}
}
As you can see, the code calls the login() function, which is similar to the one used in Chapters
24 and 25. If all goes well, we register the username in the session variable $auth_user.
Building a Web-Based Email Service
C
HAPTER 27
27
BUILDING A
WEB-BASED
EMAIL
SERVICE
631
33 7842 CH27 3/6/01 3:41 PM Page 631










