Advanced webcoding: PHP – Part 1
Continuing my series on webdevelopment I’d like to spend some time explaining PHP. These series of tutorials will be the “most complex” so far. Before you continue, you should really have good knowledge of HTML (which I also wrote some tutorials about: PT 1, PT 2, PT 3, PT 4).
This will only be an introduction post, just to make you clear what you are dealing with. A few practical examples will follow in the next few tutorials.
PHP is a scripting language (du’h) designed to create dynamic web pages. Also this language needs to be embedded in HTML in order to work. You should know that PHP is very different from HTML. You can’t just “open notepad and start typing code”. In order to run PHP pages you will need a PHP webserver (don’t worry it really is less impressive than it sounds).
Also, PHP is typically used in combination with a database. So you can actually write a webpage that allows you to push or pull data from the database. The most commonly used database in combination with PHP is MySql. So yes, in order to write dynamic PHP pages you will need to have some basic knowledge of SQL (tutorial can be found here (yes I have too much free time)).
Let me first show you how you can install a “webserver” which allows you to run PHP. Since I’m currenly using a windows computer I will be using WAMP:
- Windows: the operating system
- Apache: the HTTP webserver
- MySQL: the database
- PHP: the coding language which by the way stands for Hypertext Preprocessor
If you are using Linux for example you can use LAMP. See the logic? ;-)
WAMP is an installation which allows you to run a “webserver”, but it is really light weight. You can install it on virtually any windows computer. You can find the installer right here.
I’m not going to add any screenshots because the installation is so very simple anyone can do it. Next, next, next, finish!
Once this is done, you can launch the WAMP server (if this hasn’t already been done by the installer). If you do this, you’ll notice a new icon next to your windows clock. Hey that wasn’t there before!
Correct! This is the WAMP control center, you can start, stop and destroy anything WAMP related with this.
When you start up WAMP you’ll notice that the W icon is green. . This means all systems are go ;-)… Open up this link: http://localhost.
You should now see a server configuration page. Once you can see this, you’re good to start running some PHP pages ;-).
Until next time!