php lesson 2

What you won't need

When I started teaching myself programming many years ago from tutorials here and there on the net just like you are doing now, I had a very hard time about it. The reason being that most programming languages while slightly different from each other, do have a lot of similarities and most tutorials on any one particular programming language always seemed to assume that you already had some programming knowledge or experience with some other programming language and assumed that you knew all the jargon that went with it.

It's often said that once you know one programming language it's easy to learn others, well from my observations, that is the exact reason why.

Here at BYOGeek.com I'm going to assume that don't know a single thing about programming of any type except maybe a bit of html which I don't really classify as programming and which I cover in my html tutorials anyway.

Having said that, what you won't need is a sound knowledge and background in programming, nor will you need to be a walking encyclopedia of programming jargon, though you may become that once I'm finished with you, you have been warned!!!!

What you need

Before you can get started on php, you will need a few things.

  • Firstly you should have some basic knowlege of html, you don't need to know html back to front but some knowledge and understanding of it certainly helps so if you haven't done so already, please check out my html lessons

    As php is a server side script you may also want to have a look at my publishing tutorials aswell to have a better understanding of servers and things such s uploading.

  • Next you will need an editor, notepad is just fine, but php is not just simple web design, it is programming and can be a little more complex.

    You can get alll sorts of fancy editors, but simple is good. I recommend and editor called Sc1 you can download here. It has a simple colour scheme that comes in handy for finding and fixing errors in your code.

  • Next, you will need a server environment with php capabilities to run your scripts on, there's a few options for this I'llover below.

    A server environment

    Huh? a server environment?? WTF??? take a chill pill and settle down, everything is going to be fine.

    Unless you skipped the previous lesson, you would have been directed to publishing lesson 2 which explains what a server is, and you should also know what we mean by "server side", if not, go back to php lesson 1 and learn, learn, learn.

    Ok so we know that php being a server side script means that the server interprets and executes(runs) our code before sending to our web browser to display. This means that unless your computer is setup as a server, you won't be able to run your php programs on it.

    One way around this is to upload your php files to your host(again, check my publishing tutorials on how to do this) and run them from there.

    Ideally though ytou will want to test your scripts on your local machine before uploading them. One way to do this is set your computer up as a server, download php from php.net and install that on your computer, then you would also want to download and install MySql.

    All that can be a tricky and laboursome task, not to mention that you probably really don't want your computer set up as a server, so what I recommend instead is that you download and install wampserver from here and install it.

    Wampserver is like a mini server set up, a claytons server if you like, the server you have when you're not being served. It's a testing environment that works like a server, complete with php and mySql and it will allow you to test your php webpages offline.

    My php tutorials will be based around using wampserver.


    Ok, so once you've got your hands on a decent editor, gotten your head around some html, got a slight understanding of servers, dowloaded and installed wampserver, then continue on to php lesson 3 where the fun starts with writing your first php program.


    Lesson added Friday 1st May 2009