PHP is a popular and freely accessible programming language. It's a server side language used to build websites and web apps. The language has been used in more websites than any other programming language in the world today, and it's the core subject of this blog. Now there are many other programming languages out there, however in this blog we'll be focusing on how PHP interacts with a few of those to build a fully functional website.
Please don't worry, PHP is a relatively easy language to learn. We'll take it slow and get you acquainted at a simple and controlled rate. Feel free to click through the provided links in these tutorials for more information.
A variety of popular web development CMSes(Content Managemen Systems), such as WordPress, ExpressionEngine, Drupla and Magento were built on PHP. So this won't be a lonely road for you, there'll be a lot of help online.
The language can be used to handle requests to the site, and can also process data from and to the database. This means that when a user loads a page or submits a form, PHP can be able to handle those requests and also be able to query the database for the data needed on that page, or process the data from a form before it's saved into the database.
PHP can also be useful for a site's user interface; the part of the site that a user interacts with. This would be the page itself, with the buttons, forms and image sliders amongst others.
In programming no language is an island, every language relies on another to build any piece of software. One of the languages used to build sites together with PHP, is HTML (Hypertext Markup Language). Think of HTML as the structure of the site, the frame, the brick walls without the windows, without the doors, without the roof, etc. HTML is just the main structure, in which we insert everything else; meaning the buttons, the forms, the sliders etc.
Take a breather, get up, step away from the screen, grab a coffee, some roasted nuts, and a pack of chocolate roasted raisins. Because we're about to get into some really nerdy stuff. But once again, fret not, we'll break down all this jibberish in the coming tutorials.
"Alright,alright, alright" - Matthew McConaughey ...
The odd part below, that part with the sgueakly arrows and the odd names; that's HTML. That's right, you are looking at your first piece of code.
<!DOCTYPE HTML> <html> <head> <title>Title of the document</title> </head> <body> The content of the document...... <?php echo 'embedded code'; ?> </body> </html>
This part of the code above:
<?php echo 'sample php code'; ?>
is the php embedded into html. Everything else is html. Don’t worry we’ll be explaining all this html, php business a bit later in our journey. So don’t run yet.
"Alright, okay" - Denzel Washington ... Go get some coffee and a banana; when you get back we’ll get into some really geeky stuff
Let’s start by setting up your development environment
Cape Town, South Africa