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.

17<br />

Implementing Authentication with<br />

<strong>PHP</strong> <strong>and</strong> <strong>MySQL</strong><br />

IN THIS CHAPTER, WE DISCUSS HOW TO IMPLEMENT various <strong>PHP</strong> <strong>and</strong> <strong>MySQL</strong> techniques<br />

for authenticating users.<br />

Key topics covered in this chapter include<br />

n Identifying visitors<br />

n Implementing access control<br />

n Using basic authentication<br />

n Using basic authentication in <strong>PHP</strong><br />

n Using Apache’s .htaccess basic authentication<br />

n Using mod_auth_mysql authentication<br />

n Creating your own custom authentication<br />

Identifying Visitors<br />

The <strong>Web</strong> is a fairly anonymous medium, but it is often useful to know who is visiting<br />

your site. Fortunately for visitors’ privacy, you can find out very little about them without<br />

their assistance.With a little work, servers can find out quite a lot about the computers<br />

<strong>and</strong> networks that connect to them, however. A web browser usually identifies itself,<br />

telling the server what browser, browser version, <strong>and</strong> operating system a user is running.<br />

You can often determine what resolution <strong>and</strong> color depth visitors’ screens are set to <strong>and</strong><br />

how large their web browser windows are by using JavaScript.

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

Saved successfully!

Ooh no, something went wrong!