HTML Goodies: PHP Tutorial

By Vince Barnes

Are you wondering what all the talk is about?
Wanting to learn to use PHP?

Read on!

From what you hear being said about it you could be forgiven for thinking it to be the panacea for all that ails the Web development world. There are those who would argue that you would be right in thinking that. While I may not quite go to that extreme, I will join those who will not argue against the notion! It is indeed a very useful weapon in the Web Designer's arsenal. So what exactly is it? Where can you get it? How much does it cost? How do you use it? Whoa there, Nelly! That's what this little series is all about. This is an introduction to PHP intended to give you a foundation for its use and to guide to resources you can use to get deeper into the PHP world. PHP is gaining ground quite rapidly and is being accepted and used in some very demanding and traditionally cautious environments. There are good reasons, so you are encouraged to read on!

PHP started its life in 1994 in the mind and hands of one Mr. Rasmus Lerdorf. Recognizing the virtue of his creation a number of very talented programmers have lent their skills to its development, and have included a number of complete rewrites along the way. The latest release, PHP4 comes from a company called Zend. PHP is an Open Source project, meaning that its source code is available for you to study, use and modify, should you so wish. Its name originally stood for Personal Home Page, but it has since adopted "PHP Hypertext Preprocessor" (GNU, the open source project is fond of recursive names like its own "GNU's Not Unix".) PHP is free. It can be downloaded from or, for PHP4,

PHP is a Server Side scripting language. Compare that to JavaScript, which is a client side scripting language. The main difference between Server Side and Client Side concerns what data you can manipulate and when. If you want to manipulate data that is in databases on the server, then you need to use server-side technology. The web pages themselves also reside on the server, and so are also manipulated by server side technology. Once the page has been displayed on the client machine you need client side technology to manipulate data associated with it. For example, if you have displayed a form on which your site visitor is entering data and you wish to validate that data, allowing the visitor to make corrections, before sending the data back to the server, then all that validation must be performed by client side technology.

PHP code runs on the server, not on the client. If you write PHP code, perhaps extracting data from a MySQL database, you are writing server side code. On the other hand, if you write some JavaScript, it is included with the HTML that is the web page and is sent down to the client computer for processing. The HTML code in the page and the JavaScript are both examples of client side technologies. To communicate between server side and client side technologies, data must be transmitted back and forth between the server and client computers. More about all this later on!

Before you can take advantage of PHP extensive capabilities, it must be installed and available on the server hosting your website. Here's some good news! PHP is platform friendly. It runs on Windows, Linux and many flavors of UNIX, so the chances are it can be installed on your server if it's not already there. Because of its popularity most hosting companies these days offer support for PHP. If you're not sure about yours, call and ask them. If they don't support it, ask them why not, then choose another host!

Other server side languages, competitors if you like, include PERL, ASP (Active Server Pages) (&ASP.Net), JSP (Java Server Pages), Alaire's Cold Fusion and others. PHP has some advantages over its competitors. It's free - a tough price to beat! It's very efficient, making it capable of handling millions of daily hits on one inexpensive server (check out the benchmarks on ) It's portable, meaning that it's easily moved from one platform to another (it's not identical on Windows and Unix/Linux, but it's very close - there would be only a few things to be changed.) It integrates with a variety of Database Management Systems (DBMS) including MySQL, which is also free! The list of DBMS is quite extensive and includes support for any systems that provides an Open Database Connectivity Standard (ODBC) driver, as most do.

Another big advantage of PHP is that it's easy to learn. That's what we're all about here. As previously mentioned, this introductory piece is to lead you into a new tutorial series that will provide a foundation for you to begin using PHP. We will be covering the basics of the language and providing some usable examples. In addition, we will be guiding you to some resources that you can use to increase the depth of your understanding of PHP and to expand the range of things you can accomplish with it. Gone are the days of the old static web page (well, almost!) Welcome to the dynamic world of interactivity and database connectivity on the Web!

Continue to the next part of this Tutorial

Return to the Tutorial Series Index

Make a Comment

Loading Comments...

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
Thanks for your registration, follow us on our social networks to keep up-to-date