Why So Static? The Difference Between Static and Dynamic Websites

By Bobby Martinez, Monday, February 8, 2010
small-business-mobile-app

It used to be the case that websites were simple text documents that you downloaded to view on your Prodigy or AOL browser. Then again, you also used to be able to have dinner and watch Saved By The Bell by the time it actually downloaded, but the World Wide Web has come a long way since then. Websites are no longer restricted to being online versions of pamphlets. In fact, they run the gamut from expansive social networking services like Facebook, which has many millions of users, to small personal websites that receive maybe 5 visitors a month.

Websites used to be as simple as HTML (Hypertext Markup Language) code embedded in a single file per page. While this was great for simplicity, it didn’t do much in the way of functionality. The pages could only display one static set of information per page. In today’s current version of the internet, one web page can display a variety of different information depending on what the user inputs. These types of websites are known as dynamic websites because they dynamically generate the web pages each time a visitor visits a page, using a set of data that is retrieved from a database.

Example of the way a static HTML page works

1) You type “www.example.com” in the address bar of your web browser, and your web browser sends a request to the server of “www.example.com” for the contents of the web page.

2) Your web browser downloads the content of the home page at “www.example.com” in the format of an HTML document.

3) Your browser reads this document and then displays it in your web browser as a web page.

The way a dynamically generated page works is a little different. Let’s take this blog as an example. This blog runs on a popular blogging platform called WordPress. The WordPress software uses a combination of PHP code and a MySQL database in order to dynamically generate web pages. PHP is a server-side scripting language, which means that all the processing is done on the webserver, as opposed to a client-side script like Javascript that runs on your local machine. The short explanation of MySQL is that it stores data on a database server, which can be retrieved through a series of “queries”. If you would like to know more, you can read about it here: MySQL

Example of the way a dynamically generated web page works

1) You type “www.webii.net/blog” in the address bar of your web browser, and your web browser sends a request for the contents of the web page.

2) The page “index.php” runs its PHP code on the web server, which includes MySQL queries for information from the database. This includes a query of the “latest posts” that WordPress stores in the MySQL database. The “index.php” file finishes running its code, and it outputs the result in HTML.

3) Your web browser reads the HTML output of the PHP file and then displays it in your web browser.

Either way, your browser still receives and displays HTML information, but the manner in which it is retrieved is very different. The “index.php” file can put out different results depending on the user input. When you click on the “about” link in our blog’s navigation bar, you are actually calling the exact same “index.php” file, but this time the page is dynamically generated to display the “About” information that is stored in the MySQL database. Neat, huh?

Dynamic websites are not for everyone. If you simply need to display a couple of pages of text and images, then sometimes bare-bones HTML pages can suffice. If you need something better for your organization or business (or even just your personal website), dynamically generated web pages can be designed to give multi-tiered security access, allow you to update your web page from anywhere on the web, and many other powerful features that can turn an otherwise uninspired website into a full-blown online presence, a tool to help you get things done.

Posted in: Austin Web Design, Web Design, Web Design Resource, Web Development, WWW Learning Center

Comments are closed.