Home Logo
Show Full Menu
Hide Full Menu
 

Welcome to PHP

Created: 30/09/10 Views: 924 myFave Image

In this introduction we will learn what PHP is and how we are going to use it
PHP stands for Hypertext Preprocessor and it is just another scripting language used in web development, just like HTML, however PHP can do a lot more for you than HTML.
Before we begin this tutorial series I highly recommend you get up to scratch with HTML and CSS so that you only have to concentrate on the PHP scripting, if you are up to scratch then lets begin.

PHP works a little differently from a script like HTML, and I'm not going to get into the knitty gritty details, they aren't that important, as long as you can understand why it's different and how you can use it to great benefit then you are set.
PHP works on in the background, it processes data and returns finish products, and it's because of it's backstage presence we can use it to make wonderful things happen with our website without the end user aware of all the brain work that's happening. Now to some people this may immediately seem like it could be quite difficult to learn, and I'm not going to tell you it's as easy as learning your ABC's but if you think about things logically, take it slowly and use a bit of trial and error, then you'll have no problem at all, after all, I've managed to teach myself, so hopefully through my experiences I can provide you with just the right information you need to be Mr or Mrs PHP!

Some examples of why we would use PHP
  • Process forms
  • Manage database content
  • Create member areas
  • Include other files
  • Edit images
  • Send e-mails
  • Create files and folders
  • etc etc etc


Ok, so that's the little introduction over with, there is just a couple of important things we need to go over before we move on.

Firstly you need to know how to include PHP into your web pages and that is where the .php file type comes in. If you use the .php (example: index.php) file type you are able to include PHP, otherwise the php tags will not be recognized. Secondly, you need to know the php tags themselves, and they are like this;
  • <?php
  • // Some PHP scripting goes here
  • ?>
Simple as that, <?php indicates the beginning of the PHP script, and ?> indicates the end.

Secondly the important thing is to have PHP installed on your server, if it's not installed it's not going to work. Unlike HTML where it works via the browser reading the script and displaying it, PHP requires the web server to make all of its tasks work.

So if you're not sure if you have PHP installed or how to, you'll need to do either of these,

1. Get yourself a domain name and hosting, either a free version or a priced one, I would personally recommend purchasing a domain name and hosting account as free hosts do tend to be very limiting, if you aren't sure where to start with getting such things I would recommend 123-Reg for the domain name and JSHosts for the web hosting, they are very reliable, very cheap and very helpful, I've certainly never had anything bad to say, and with them if you choose the basic cheap hosting, it will do far more than you'll need it to!
Note: You may have to wait around 24 hours for your account to be 100% active.

2. Get a local server set up, and for this I personally only recommend one program for the job, and that's Xammp, it's free and reasonably simply to set up and will do everything you need it to.
Note: For any confusion on set up, follow the tutorial on this in the Misc tutorial Subject.

Now, if you've got php set up, you may now carry on with the rest of the tutorials to become the PHP expert!


next tutorial: Print and Echo

There are no comments