Introduction to Web Dynamic Content:

ugliestharrasSoftware and s/w Development

Nov 4, 2013 (4 years and 8 months ago)



Introduction to Web Dynamic Content:

Designing For

Content WEB

With the growth of the Web, there has been a similar growth in the in the
services that are accessible over the Web. Many new services are web sites
that are driven from
data stored in databases. Well known web destinations
such as online stores, auction sites, discussion forums and personalised
homepages are examples of dynamic web data base applications. The
popularity of these applications stems from their accessibilit
y and usability;
thousands of users can access the same data at the same time without the
need to install additional software on their machines

Static Vs Dynamic

In the beginning of the Internet, almost all content was entirely made of static
HTML and t
ext documents. Many first generation web sites and even some
new web sites launched today are composed of static, non
changing content.
Very quickly, these web sites become old and outdated and are not much help
to the consumer. A static web site usually c
ontains minimal information and
some contact information. On the other hand, a dynamic web site contains
pages that can be changed by any program, script or administrator at any
time. A dynamic web site usually contains functionality that cannot be found
n a static web site.

Typical Dynamic Web Site

A shopping cart website is a typical example of dynamic content. The user
can view products, product information, price, stock level and availability. If
the user then decides to buy products or items (add
to the shopping cart etc),
several pieces of information immediately change in the users browser.
Typical content change is:

Items purchased

Cost for each item

Total cost

Balance of account

The user can continue to add more items and can view the updat
information. If the user then decides to change the items in the shopping cart
the information changes. At the end of the process, the user may decide to
buy. A login and password is normally required which verifies and identifies
the user.


Next, the

user is provided with specific information relating to their account.
After purchasing the products in the shopping cart the user may be presented
with an invoice via email, showing the order placed and the amount payable
or directly debit an account. The

information relating to products and stocks
etc is constantly being updated.

This is a typical example of a website which includes DYNAMIC CONTENT
and is DATABASE DRIVEN. In other words, the content in website is
dynamically updated by information stored

in a database. The information in
the database is also updated dependant on the user input and request.


What is a dynamic website?


Dynamic refers to a type of site where each page is created by
the server dynamically, every time it

is requested by the
browser. In other words, the pages that you see are only
templates, and the actual content is stored elsewhere, usually in
a database.


What advantages do dynamic websites provide?


Reduce maintenance and administra

Help distribute the workload

Increase the responsiveness of the web site

Large volumes of content can be up very quickly

Dynamic Content Components

There are many technologies available for creating a dynamic website, and
they can be combined in e
ven more ways to form a programming platform.
There are several technologies for scripting which include:

JAVA Server Pages)

PHP (PHP Hypertext Pre

Active Server Pages)

Perl (O
ne of the first scripting languages used for CGI programm

Coldfusion (
Macromedia technology, which allows a scripting language
directly within an html document on the server.

There are also different technologies for storing data, which include:





Microsoft's SQL Server


r this module we will be using PHP as the scripting language and MySQL
for the database.


PHP (Scripting Language)

PHP is a popular choice for the following reasons:

Open source (entirely free)

Community efforts to maintain and improve it are unconstra
ined by
commercial influence.

One or more PHP scripts can be embedded into static HTML files

Fast execution of scripts

Platform and operating system flexibility

Fully featured programming language suited to complex systems

MySQL (Database)

MySQL is Database Management System (DBMS) and is a popular choice for
the following reasons:

Open source (entirely free)

Fast execution

Low resource overheads

We will use PHP scripting language with its extensive function libraries that
interact with m
any database systems and the web environment. This develops
the applications logic that brings together the Web and the relational database
management system (RDBMS) to create dynamic Websites.

PHP & MySQL How it Works.

A typical PHP page will contain
a number of PHP elements along with
HTML mark up elements and other textural content.

When a Web browser requests a PHP page from a Web Server that is

enabled, the server will call up the PHP parser to process all the
elements on that page.

The PHP p
arser executes the PHP script instructions on the page,
generating a HTML document that is sent to the Web browser as a
response to the original request.

The PHP parser may also be asked to retrieve and update information
from the database

Code that i
s executed on the server such as PHP is called ‘server side’ code.
The HTML page containing the PHP script must be on the server to function
correctly. In order to provide Dynamic Web Sites using PHP and MySQL the
Internet Service Provider Web Space must b
PHP and MySQL enabled.


Figure 1 shows the systems components required for delivering dynamic web
content using PHP and MySQL.

Dynamic Web Site Examples

Web pages that contain PHP script can normally be identified in the
address by the .php extension.

Student Exercise


Browse the Web and identify
gallery web
sites you think are using PHP
and databases to provide dynamic content.


Try to find

examples of
dynamic content
eb sites. Make a list
so we can h
ave some discussion.


Look for Web sites that will help you to learn PHP and MySQL


Have a look at the source code
in the browser
for PHP Web Sites. You
will find some thing very interesting.

What have you observed?


Web Browser



PHP parser




PHP Script






Dynamic PHP





Figure 1
Dynamic Content