DJ Mike's Tutorials: PHP



< ^ >


Introduction

First of all I have to say that I am not an expert on PHP. Not even close. So why am I teaching PHP? Because just about all the online tutorials, even the ones that say they are for non-programmers, start off with something like, "PHP is an object oriented programming language". Say what? I couldn't even get past the first paragraph. This tutorial is not intended for someone who already knows what an "object oriented programming language" is. This tutorial is intended for people who know nothing more than HTML and maybe javascript.

HTML vs Javascript vs PHP

HTML

HTML is a static, client side language. Your browser asks a server for a file, the server gives the file to the browser and the browser figures out how it should look, what color to make text and backgrounds and where to place images. Different browsers my display things a little differently. Webtv has very little support for CSS so web pages that use a lot of CSS may have overlapping text or text off the screen, for example. Once the browser has the web page, it just sits there; nothing changes if you scroll up and down or anything like that.

Javascript

Javascript is a dynamic client side language. Everything is still done by the browser but the page can now react to a viewer's actions. If you focus on an image, the image can swap with another. If they click something, the background color may change. Since everything is done by the browser, all this takes place without the browser making another request to the server. This also means that you are limited to the browser's abilities. Many web pages use javascript beyond what webtv can do so it causes them to freeze up.

PHP

Unlike HTML and javascript, PHP is a server side language. This means that the PHP code that you write is executed by the server before it is sent to the browser. You can use javascript to make a simple calculator but if you tried to make a function that did 10,000 calculations before it gave an answer, your box would freeze up till you unplugged it and gave the little hamster running it a rest. If you did the same thing in PHP, the calculations would be easily handled by the computer hosting the web page, then the answer would be sent to the browser.



< ^ >


Created by DJ Mike from Santa Barbara

DJ Mike


Dance Away Santa Barbara's Home Page
<a href="http://www.statcounter.com/" target="_blank"> <img src="http://c5.statcounter.com/counter.php?sc_project=1321035&java=0&security=da2193dc" alt="counter free hit invisible" border="0" /></a>