Dynamic web technologies
or making webpages that change a bit sometimes
The internet began with what we now call static HTML. These were pages who's content was written by someone, uploaded on to the internet and there it was. This didn't mean that these webpages never changed, the person who wrote the html could update the page. As you are no doubt aware, the best websites are kept up to date but this would need to be done by the website creators.
So along came the idea of dynamic webpages. The content of these pages can change automatically. The simplest example of this might be a clock on a webpage that takes the time from the clock on the computer on which the webpage is viewed. It is worth noting that if the time is wrong on the client computer it is accurately wrong on the webpage!
Another frequently used simple example of Dynamic content is a "hit
counter" which tells you how often a site has been acessed. These usually
get their "hit" information from an "external" webserver.
Many and perhaps most webpages now contain dynamic content in some form. Sites
like ebay being built entirely around this principle.
Most of these websites rely on a database(s) somewhere from which the website draws its dynamic content. The dynamic content itself can be allsorts of things; text ,numbers, images or sound and video files.
There are two main ways of delivering dynamic pages
Client side
- In this way of working the page is sent to the client computer as normal over the internet.
- the client computers web browser then processes any dynamic elements of the page. In the example of the clock above this would involve getting the time value from the computer.
- The webpage is then displayed. The most common technolgy for doing this is called Javascript although the new kid on the block is Ajax
Server Side
A bit more complicated this way of doing it.
- The client browser sends a request for a particular "page" actually this will usually run a "script".
- The server retrieves the requested script or program.
- The server runs the script or program which usually ends up with an HTML web page.
- The server sends the HTML output to the client's browser where it is displayed.
- This can be further complicated as the request for the initial "page" can be accompanied by data from a web form which may affect the page that is outputted by the server. Read that again its hard.
Popular Server Side Technologies
CGI Common Gateway Interface
CGI is a standard internet technology that allows developers to
write programs that do stuff on their webservers.
A CGI script is a program that can be run by a clients web browser but they
run on a webserver. CGI scripts live in a place (directory or folder) on the
server called the CGI bin. CGI scripts are often used as a
way of accesing databases on a webserver. Some webhosts will give you access
to there Bin of scripts, that do some standard stuff. Address
books are a common example.
Wikipedia works by using CGI scripts. When you click on a link in wikipedia
a CGI script is run on the server a particular piece or pieces of data are
pulled of wikipedias webserver and turned into HTML then displayed on your
browser.
This differs from a static webpage request in that if someone has just updated
the database (by editing an article) you get the up to date page.
CGI is used on my website on www.princehouse.co.uk to return the image that is made up of the results to the vote of who I look the most like.
CGI scripts can be written in any programming language but is a fairly specialised activity needing a good knowledge of coding.
PHP
PHP is another server side language and it develops on what CGI
can do.
To run a PHP command (again PHP is often linked to databases and usually outputs
a HTML page), the webserver program needs to be running the PHP Program so
its knows how to deal with PHP requests from client browsers.
The advantage of PHP is that you can make webpages or parts of webpages that send PHP commands to the webserver to do certain things and not just query a database. The webpages themselves than become "programmes" THis is unlike CGI where each Script is its own sperate programme that has to be kept in the CGI Bin. The code side of CGI in the webpages is also a simplified lower level language and it is designed to make the creation of Dynamic webpages something most apprentice nerds can do.
So PHP is an pretty simple way to build code into a webpage that will makes things happen and show you results on a server.
Oh and its open source (free), will talk to a fair range of different databases but is particularly suited to MySQL an (open source database).
ASP Active Server Pages
Microsofts' server side scripting language is ASP. It is a bolt on
for IIS and does much the same things that PHP does. Popular but only really
runs on IIS webservers. Supports in page scripting like PHP usually using Vbscript
which has a simliar language construction to microsofts visual basic and more
recently under the name ASP.net supports microsofts .net framework. This is
designed to make the process of script creation less code centered and more
like a GUI interface built on what microsoft call "controls"