13.09.2016 Views

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Implementing Administrative Functions<br />

733<br />

The display_button() function creates an image link to a script with GET parameters<br />

where required; the display_preview_button() function gives a plain link into the<br />

archive.This link pops up in a new window, achieved using the target="new" attribute<br />

of the HTML anchor tag.You can see the result of previewing the HTML version of a<br />

newsletter in Figure 30.14.<br />

Figure 30.14<br />

This preview of an HTML newsletter is shown complete<br />

with images.<br />

Sending the Message<br />

Clicking on the Send button for a newsletter activates the send action, which triggers<br />

the following code:<br />

case 'send':<br />

send($_GET['id'], $_SESSION['admin_user']);<br />

break;

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

Saved successfully!

Ooh no, something went wrong!