25.09.2014 Views

ZEND PHP 5 Certification STUDY GUIDE

Create successful ePaper yourself

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

98 ” Web Programming<br />

made for a <strong>PHP</strong> script—otherwise, the server can choose a different handler or, in<br />

the case of static resources, such as images, output them directly).<br />

Upon output, the server first writes a set of response headers to the clients; these<br />

can contain information useful to the client—such as the type of content being returned,<br />

or its encoding, as well as data needed to maintain the client and the server<br />

in a stateful exchange (we’ll explain this later).<br />

i<br />

Forms and URLs<br />

Most often, your script will interact with their clients using one of two HTTP methods:<br />

GET and POST. From a technical perspective, the main difference between these<br />

two methods is in the fact that the latter allows the client to send along a data payload,<br />

while the former only allows you to send data as part of the query string.<br />

This, of course, doesn’t mean that you can’t submit a form using GET—only that<br />

you will be somewhat limited in the size and type of data that you can send. For<br />

example, you can only upload files using POST, and almost all browsers implement<br />

limitations on the length of the query string that confine the amount of data you can<br />

send out with a GET operation.<br />

Contrary to popular belief, POST is not an inherently more secure way to submit forms<br />

than GET. We explain this concept in greater detail in the Security chapter.<br />

From an HTML perspective, the difference between GET and POST is limited to<br />

the action attribute of the element:<br />

<br />

<br />

List: <br />

Order by:<br />

<br />

Name<br />

City<br />

ZIP Code<br />

<br />

Sort order:<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!