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.

Reading Mail<br />

677<br />

Reading a Mail Message<br />

Each message in the previous display_list() function is set up to link to specific<br />

email messages. Each link is of the form<br />

index.php?action=view-message&messageid=6<br />

The messageid is the sequence number used in the headers retrieved earlier. Note that<br />

IMAP messages are numbered from 1, not 0.<br />

If the user clicks one of these links, he will see output like that shown in Figure 29.6.<br />

Figure 29.6<br />

Using the view-message action shows a particular message.<br />

When you enter these parameters into the index.php script, you execute the following<br />

code:<br />

case 'show-headers':<br />

case 'hide-headers':<br />

case 'view-message':<br />

// if we have just picked a message from the list, or were looking at<br />

// a message <strong>and</strong> chose to hide or view headers, load a message<br />

$fullheaders = ($action == 'show-headers');

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

Saved successfully!

Ooh no, something went wrong!