Static vs. Dynamic Websites: Introduction To PHP
Static vs. Dynamic Websites: Introduction To PHP
Static vs. Dynamic Websites: Introduction To PHP
A static website is created using HTML pages which have been written in a fixed way
to instruct the browser how to render the page. (What you see it what you get).
Static websites are used to display fixed information which most often does not need
to be updated on a regular basis.
As the Web evolved, sites became more complex and were expected to display
dynamic information which could not have been “hard coded” in HTML:
Search results
Number of visitors
User login
Message boards
Introduction To PHP
Dynamic websites
The solution was to generate the HTML “on-the-fly” based on parameters and
specifications.
For example, If a user asks to see search results, a unique page would be generated
specifically for him.
The user would get an HTML page, but an HTML page that was tailored made for
him.
Since there is no way of knowing every possible search result for every possible key
word, the final page is being assembled using a server-side script.
The server-side script constructs the page and then it is being sent back to the client.
This mean that the page result.html will look different each time based on the given
specifications.
Introduction To PHP
Dynamic websites
The server checks what the client has asked for and based on that constructs a page
for him based on an existing template.
The template is a page which contains HTML code and server-side code that will end
up as HTML code as well, but a different HTML each time.
Introduction To PHP
Three Tier Web Applications
Introduction To PHP
Dynamic Elements On A Page
Introduction To PHP
Automating the site and allowing it to support itself. Less pages to manually create.
Introduction To PHP
Server-Side Scripting
The application which interprets the server-side script is installed on the sever just like
any other application.
Introduction To PHP
Server-Side Scripting
They also contain more specific elements such as special objects, commands used to
communicate with the server and a database and much more.
Introduction To PHP
When there is a need to store and retrieve information (user names, items in stock
etc.) a database will be used to contain the data.
This means its free to use and isnʼt being controlled by a single entity.
PHP script will be located inside special tags, much like JavaScript
e.g. <?php //php script here ?>
What is MySQL?
MySQL is a small database server
MySQL is ideal for small and medium applications
MySQL supports standard SQL
MySQL compiles on a number of platforms
MySQL is free to download and use
PHP + MySQL
PHP combined with MySQL is cross-platform
(means that you can develop in Windows and serve on a Unix platform).
Introduction To PHP
Why PHP?
PHP runs on different platforms (Windows, Linux, Unix, etc.)
PHP is compatible with almost all servers used today (Apache, IIS, etc.)