25.09.2014 Views

ZEND PHP 5 Certification STUDY GUIDE

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

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

Chapter 5<br />

Web Programming<br />

Although you will find it used in scenarios as diverse as quality control and point-ofsale<br />

systems, <strong>PHP</strong> was designed primarily as a Web-development language, and that<br />

remains its most common use to this day.<br />

In this chapter, we focus on the features of <strong>PHP</strong> that make it such a great choice<br />

for developing Web applications, as well as some Web-related topics that you should<br />

be familiar with in order to take the exam.<br />

Anatomy of a Web Page<br />

Most people think of a Web page as nothing more than a collection of HTML code.<br />

This is fine if you happen to be a Web designer—but, as a <strong>PHP</strong> developer, your knowledge<br />

must run much deeper if you want to take full advantage of what the Web has<br />

to offer.<br />

From the point of view of the Web server, the generation of a document starts with<br />

an HTTP request, in which the client requests access to a resource using one of a<br />

short list of methods. The client can also send a data payload (called request) along<br />

with its request—for example, if you are posting an HTTP form, the payload could<br />

consist of the form data, while if you are uploading a file, the payload would consist<br />

of the file itself.<br />

Once a request is received, the server decodes the data that it has received and<br />

passes it on to the <strong>PHP</strong> interpreter (clearly, we are assuming that the request was<br />

Licensed to 482634 - Amber Barrow (itsadmin@deakin.edu.au)

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

Saved successfully!

Ooh no, something went wrong!