13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

672 Chapter 29 Building a <strong>Web</strong>-Based Email Service<br />

Figure 29.5<br />

After the account is selected from the SELECT box, the mail<br />

from that account is downloaded <strong>and</strong> displayed.<br />

This SELECT option is generated in the do_html_header() function from<br />

output_fns.php, as shown in the following code fragment:<br />

// include the account select box only if the user has more than one account<br />

if(number_of_accounts($auth_user)>1) {<br />

echo "<br />

";<br />

display_account_select($auth_user, $selected_account);<br />

echo "<br />

";<br />

}<br />

We have generally avoided discussing the HTML used in the examples in this book, but<br />

the HTML generated by the function display_account_select() bears a visit.<br />

Depending on the accounts the current user has, display_account_select() generates<br />

HTML like this:<br />

<br />

<br />

thickbook.com<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!