PHP - Dynamic Websites 101
A Beginner's Guide on PHP and Database-driven Sites
PHP Tutorial Home | Step 1 | Step 2
STEP 1 - A CRASH MINI-COURSE ON PHP
In this part of the course, I’m going to move quickly so you can see your first PHP script in action as quickly as possible. Hold on to your hats!
But don’t worry, I will be going over this again in more detail later on. If you find yourself a little confused along the way (welcome to my life,) just keep going, I promise the haze will lift soon enough!
One last point: you will not be able to learn PHP unless you know (at least) the basics of HTML! If you don’t and you still want to learn PHP, take my crash (video) course on hand-coding HTML, or visit HTML tutorial website: www.how-to-build-websites.com
THE VERY BASICS
Ok, we know that PHP is a scripting / programming language. The words ‘scripting’ and ‘programming’ are interchangeable - it’s like saying car and automobile.*
Like all scripting languages, PHP needs a place to run – a place that can understand the ‘script’. You can take the meaning of ‘script’ very literally; a scripting language is just a specialized language much like English and French are each their own languages where each has their own rules, words et cetera. Scripting languages (like PHP) are simply languages that ‘talk’ to computers.
Ah, so if PHP is a scripting language that talks to computers, why don’t all hosting companies support PHP?
That’s a good question! The answer is simple; the host needs to install a program on their servers that can understand PHP ... this program is actually called a ‘PHP interpreter’.
Just like with human languages, where we need an interpreter to say translate English to French:
English guy: “I want french fries.”
French interpreter: “He wants de French fries.”
Computers need a PHP interpreter to understand PHP. Not everyone can speak French (much to the chagrin of many a Frenchmen,) and so not all servers (servers are just computers that have ‘server’ software installed on them) can speak PHP, that’s why hosting companies need to install the free PHP interpreter on their servers.
ARE WE EVER GOING TO DO THIS THING?
So now we understand what a ‘script’ is and that we need a place to run it. The next step is to actually write some PHP script!
NEXT - STEP 2
* Ok, I just lied a tiny little lie … a true nerd would point out there is a subtle difference between scripting and programming. But no need to worry, the difference is so subtle that this nerd-nuance has no impact on what we do!Top