logo
backtop

Heath Robinson

(Posted 09:25:49 on 18th June 2007 by Rag)
With that list of software, I guess the question is “How does it work?” Well, lets start with what happens at your end. When you launch your browser, you point it towards a webpage, lets say www.eastbayrag.com. Your browser shoots a request off to your Internet Service Provider (ISP) that asks “where do I find www.eastbayrag.com” Your ISP answers with “I don’t know, but this server over at ZoneEdit does” so it trundles off to ZoneEdit to get the IP address. When it gets the IP address (which is kept updated with Inadyn software) it then points you to my server. The request comes into my server and is picked up by the Apache software. This figures out which page you want and gives it to you.

Now, from my end, I get to control what you get to see. Apache is configured to pick up index files if you request a directory and to perform different functions on different document types. Basically, .html files are just given to you, .php files are read and parsed for includes (e.g. the header and footer of most pages are the same and this is achieved through an include rather than repeating the same code over and over again on each page) and .php files are pre-processed with PHP.

PHP allows me to script items as we go along making it easier to maintain the website without creating thousands of pages. Some examples of this are as follows:

1) The photos pages display thumbnails of each image and allow you to double click to view a larger image. Each directory is created the same with a subdirectories of “small” and “big.” The PHP code looks in the small directory and displays all the images in the table format you see. It also embeds some javascript that allows the double click function.

2) The blog pages are sections stored in a MySQL database. PHP is used to retrieve the information and display it according to which blog you select. When you submit a comment, you make an entry that is picked up by PHP and put into the database so it can be retrieved later.

In its simplest form, the PHP script does something and then outputs it in another code (HTML/XHTML) that can be read by your browser. Hence the term pre-processor. So you use one language to write another language. Actually a little more complicated, HTML/XHTML can’t do anything it just displays stuff. Javascript is a language that exists on your browser that allows things to happen, so PHP is used to output to multiple languages that are read by your browser. The easiest example of this is the buttons at the top of this page. There is a little bit of javascript that basically says when you put your mouse over the top of the button to swap the image.

Simple really!!
0 comments

 

This is a Build Your Own Blog entry.