HTML and CSS Reference
In-Depth Information
SERVER-SIDE LANGUAGES AND HTML5
Using HTML5, all of the processing is done on the client — your browser on your computer.
In a larger context, that's called client-side processing. Your browser parses the HTML5 tags
and displays the Web page that it retrieves from a Web server. All the Web server does is serve
you the HTML, and your browser does the rest.
Server-side processing is dif erent. h e server — a PHP server, in this case — processes the
information it gets from dif erent sources and sends HTML to your browser to show on your
computer. h e big dif erence is that the server can interact with other kinds of data that your
browser cannot. For example, it can interact with a database that stores data that anyone can
send in via the Web.
Going back to our example of rewriting your Web page every time you want to make a blog entry
or comment, that's pretty much what PHP does. Imagine that PHP is a little (overcaf einated)
mouse that lives in the server and is really good at writing HTML5. Whenever you make a blog
entry or someone posts a comment, the mouse quickly rewrites the HTML5 so that your Web
page rel ects the changes. h at's how PHP works. Figure 16-1 shows an illustration of the process.
Client-side processing
Client
Server
Requests HTML5 Page
Returns HTML5
326
Server-side processing
Client
Server
Storage
Requests PHP Page
Returns HTML5
Figure 16-1: Client- and server-side processing.
In Figure 16-1, the real work is between storage and the server. h e information in storage has
to be coni gured in a way that it can be read by your browser. And that's what PHP does — it
takes the stored information (sent in as a blog entry, for example) and sends it back as HTML5.
SETTING UP PHP ON YOUR COMPUTER (WHICH THINKS IT'S A SERVER)
You can access PHP in three ways:
Sign up for a hosting service.
Download and install a server and PHP on your computer.
If you have Mac OS X, it's already on your computer — just coni gure it.
Search WWH ::




Custom Search