Specifications
$query = “select count(*) from accounts where username = ‘$auth_user’”;
if(db_connect())
{
$result = mysql_query($query);
if($result)
return mysql_result($result, 0, 0);
}
return 0;
}
The get_account_list() function is similar to the get_accounts() function we looked at
before except that it only retrieves the account names.
If a user has multiple accounts registered, he will need to select one to use. In this case, the
headers will contain a SELECT that lists the available mailboxes. Choosing the appropriate one
will automatically display the mailbox for that account. You can see this in Figure 27.5.
Building Practical PHP and MySQL Projects
P
ART V
638
LISTING 27.7 Continued
FIGURE 27.5
After the localhost account is selected from the SELECT box, the mail from that account is downloaded and displayed.
33 7842 CH27 3/6/01 3:41 PM Page 638