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.

394 Chapter 17 Implementing Authentication with <strong>PHP</strong> <strong>and</strong> <strong>MySQL</strong><br />

If these parameters are present <strong>and</strong> correct, it will display the secret content.The sample<br />

test content is shown in Figure 17.3.<br />

Figure 17.3<br />

When provided with correct details, the script displays content.<br />

The code to create the functionality shown in Figures 17.1, 17.2, <strong>and</strong> 17.3 is shown in<br />

Listing 17.1.<br />

Listing 17.1 secret.php—<strong>PHP</strong> <strong>and</strong> HTML to Provide a Simple Authentication<br />

Mechanism<br />

<br />

Please Log In<br />

This page is secret.<br />

<br />

Username: <br />

Password: <br />

<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!