08456 520389
PHP a recursive acronym for PHP: Hypertext Preprocessor is a language we use to create dynamic web pages. A dynamic page is a page that displays different content based on certain conditions. Still lost? don't worry, it's not the easiest thing to grasp, but hopefully our example below will help.
There are two main types of website static sites and dynamic sites. Let's say we want to have a website with five pages. If we choose to build the site with static pages, we will need to create five individual files (pages) and make sure all the references to each other are correctly made on every page. Its simple terms its like doing the same job five ties over.
Now, with a dynamic site, we only need one file. Why? Because using PHP as our backbone for the dynamic site, we can feed that one page certain conditions, I.e. If the user clicked on the About Us button, show the about us details in the middle of the page. If the user clicks on the Contact Us page show the contact form in the middle of the page.
So at its simplest using PHP can save developers like us hours of time and get your website built within the time you need it. PHP does get an awful lot more complicated than this and allows us to utilise useful functions like date and time, mathematics and the list goes on. For more infomration on PHP and the functions it provides visit php.net
Whenever you find a site written in a scripting language like PHP. You will most likely find that a database is being used to store information. The type of system we use to manage databases (which works superbly with PHP) is mySQL by Sun Microsystems.
Not sure what a database is? Think of a database as a filing cabinet (something we use to organise and store information. within that filfin cabinet we have different drawers (tables) to store different types of information. A table simply consits of fields and values. For example Let's say we want to store some infomation about the members of our club. We would create a table with relevant fields to those members. The diagram below should make it a little clearer.
| Title | First Name | Last Name | Date of Birth | Membership Number | Email Address |
|---|---|---|---|---|---|
| Mr | Jools | Jameson | 24/02/1982 | 123425 | jools@aol.com |
| Mrs | Olivia | Green | 22/02/1984 | 346532 | olivia.green@tiscali.co.uk |
| Mr | Alf | Smith | 12/05/19976 | 456456 | alf@yahoo.com |
Why store this information in a database. Well, by keeping the information in a database, we can use PHP to ask particular questions to the database and display the information dynamically. Not only can we ask the database questions (Queries), we can also tell it store certain information and the information can be relayed back to us in seconds.
Example: Click here to popup up a window showing our most recent website work. As soon a you click the link, a query will be performed on the datbase and PHP will be used to display the result in the popup. It will also show you how quickly the query was performed
An example of a dynamic site is Ebay. Ebay provides information to your browser dynamically based on certain conditions. Some of the tables in ebays database will most likely include something like the following.
Members Table - Contain information about the members (users_ of ebay) and their login information
Items Table - Containing information on the items that are being auctioned on ebay.
FAQS Table - Containing a list of frequently asked questions and answers.