Web Design

(Nancy Kaufman) #1

272


M


any Web sites need to be able to respond to changes such as new members joining a site or
customers adding items to shopping carts. Dynamic sites typically either retrieve information

from or write data to databases, although they may also be used to send or receive e-mail, gather


information from other sites, or perform any number of other tasks. HTML does not provide the


capabilities to offer dynamic content. Other programming languages, however, offer the ability to


generate HTML documents at the moment a user requests them.


Understanding Dynamic Web Applications


Static versus Dynamic Sites
Static sites contain HTML pages that appear to the user
exactly as the designer or developer wrote them. In order
for the content on your static site to change, you must
open the code in your editor, make the changes, and then
upload a new copy to your server. Dynamic pages, on the
other hand, contain scripts executed on the server. A
dynamic page looks and behaves differently for each user
who encounters it.

Static


Changes to upload

HTML

Developer

Dynamic Page Capabilities
Dynamic sites can accept and process information submitted by the user via a Web form, such as search
engine forms, e-commerce site order forms, blog comment forms, and social networking status forms.
Dynamic pages might also change based on the time of day the page is displayed or the region or locale of
the user. They may also be updated by the Web site owner, such as the posting of a new blog entry.

Dynamic Languages
Dynamic sites are primarily written in a server-side scripting language.
Although many dozens of languages exist, some of the more popular are PHP,
ColdFusion, ASP, and ASP.NET. Each language has distinct advantages and
disadvantages. The examples in this chapter demonstrate how to create a
simple dynamic site using PHP.
Free download pdf