Sometimes it is desirable to have web pages that are
dynamically generated from a database each time a user visits them, based on
user login, or generated from the user's previous entries in a web form. The
site owner usually wants to keep the data and logic of page generation hidden
from the viewer, so a client-side script is not appropriate (since client-side
scripts are text-based, embedded in the HTML page itself, and can only operate
on data that is also embedded in the HTML page, they keep neither the data nor
the program secret). So, the usual practice is to store data in a database
program running on the web server (or perhaps a separate database server), and
generate the HTML pages the viewer sees from programs or scripts also running
on the web server.
These so-called "server-side" scripts and programs
can be quite complex, and can be written in any programming language. When the
web server receives a request (from the user's browser) for a particular page,
it passes the request on to the server-side script or program, which could
gather information from a database, read information entered by the user in
forms, do text manipulations, or perform numerical calculations; the program
then puts the result in HTML format. This end result is passed back to the web
server, which sends it to the user's browser for display as a standard HTML
page.
The most commonly-used database programs for web pages are
MySQL and Microsoft SQLServer; some web pages also use Oracle, PostgreSQL, and
other databases. And while server-side programs can be written in any language,
the most common languages are PHP, Perl, and ASP/Visual Basic/C#; some
server-side programs are also written in JSP/Java, C++, and other languages.
Typically, a software developer is needed to write server-side scripts, but
some pre-written scripts can be purchased or downloaded for use by less
technical web designers (such as scripts for shopping carts, guest books,
form-email, blogs, and forums).
There are also collections of server-side scripts known as
"content management systems", which are pre-written scripts for
managing web site content. My article on Web Programming Resources has
a review of several content management systems.
No comments:
Post a Comment