web analytics

Introduction to PHP for beginners

So you have mastered HTML, CSS, and Javascript. Whats the next step? Sure you can make awesome looking static pages in HTML, but the web is much more than that. The web is ever changing and you need to create you web pages that will compensate for that changing content.

So you have mastered HTML, CSS, and Javascript. Whats the next step? Sure you can make awesome looking static pages in HTML, but the web is much more than that. The web is ever changing and you need to create you web pages that will compensate for that changing content. Whether it’s a full CMS (content management system) or just a simple form that sends a question to your email, there has to be code behind the scenes making everything work. 9 chances out of 10 this language is PHP; What is PHP? Well it stands for PHP: Hypertext Preprocessed and its a “General purpose scripting language that was originally designed for web development to produce dynamic web pages.” basically it was made to work perfectly within HTML and also uses databases to store information, so it’s the both of both worlds. Let’s get started learning this wonderful programming language.

Testing Environment

As you can imagine, there is a lot more stuff going on behind the scenes with PHP than there would be with just HTML,CSS, Javascript which is built into browser functionality. PHP is a server-side scripting language which requires a PHP server. This could be either on your web server (most paid hosting includes PHP) or you can set one up locally. For this tutorial I will show you how to set up your server on your own computer(locally). To do this we need to download some software.

Mac Users

For Mac users I will direct you to a great program called MAMP (Mac apache Mysql PHP) download and install that, the free version should be more than enough to start out, but if you find yourself needing more the paid version is great.

Windows Users

Windows users may have a little less pretty interface, but it still works! A program call WAMP (Windows Apache Mysql PHP) Just download and install.

I will be doing this tutorial on a Mac so everything will be in MAMP but everything is very similar in WAMP. For both, make sure that your server is up and running. To do this on MAMP click on the app (the one that looks like an elephant) it will ask for the admin password, then you will be connected a web page will open confirming it’s success. With WAMP click on the icon, it will place an icon in the bottom right bar by your time (the icon looks like a meter of some kind). Click on this icon and select start all services. For more information on how to use WAMP check this out WAMP Docs. Now that we have our servers running it’s time to get started with the fun stuff, Writing the PHP.

Bare Bones Basics

This section I will talk about the very basics needed to get your first PHP application going. If you have already seen php code before than you will recognize some things, but go ahead and read over the information because if you mess up these very essential pieces of the PHP picture than nothing you write in PHP will work. So pay attention and you will be fine.

Article Source:  http://www.webdevtuts.net/coding/php/introduction-to-php-for-beginners/