Open Source Desktop Web (OSDW)
Everything about Open Source and other stuff...


 

PHP Programming

A Flexible and Effective Way to Create Dynamic Webpages

PHP is a language developed in the mid-1990s for producing dynamic web pages.  It's used mostly for scripting on the server side, but it can also be used in standalone graphical applications or a command line interface.  The main implementation of this language is produced by the PHP Group, and released under the PHP license.  This implementation creates a standard for PHP, but there's no formal specification.  PHP qualifies as free software – programs that can be modified, studied, and used without any restriction, as well as being redistributed and copied without restrictions.

This means that PHP can be used on pretty much every platform and operating system, from Microsoft Windows to Linux and Unix variants, to Mac OS X.  It also supports most web servers, including Apache, Personal Web Server, the Netscape and iPlanet servers, Microsoft Internet Information Server, Caudium, and many others.  PHP's flexibility makes it a popular option for people who want to be able to script their web pages from the server.  PHP's roots are in C and C++, standards for programmers for many years.  This means that the syntax is similar to those languages, making it easy for people who already know them to pick up PHP. 

While websites running on PHP are treated like normal HTML by browsers, they offer many more features.  For instance, PHP allows the inclusion of PDF files, Flash videos, and alternate forms of text output, such as XHTML and XML.  It also allows you to support a wide range of databases, including SQL variants, ODBC, Oracle, dBase, and many others.  If you're using ODBC – the Open Database Connection standard, PHP will allow you to connect to any other database in the world that uses this standard. 

PHP programming can be used to implement a search engine just for your site, as long as you're using version 4.0 or above.  This can provide significant functionality for large sites with many pages.  You can also use PHP to perform math or logic problems, manipulate files, and access data more quickly when you combine it with a database.  It's used to set cookies, manage site authentication, and redirect users to different sites.  PHP programming can also create forms, much as CGI does, for visitors to enter information into.  That information will then be sent on to its destination (an email to you, a display on a web page, etc.)    No matter how you need to control and alter the content of your web pages, PHP can help.

Since PHP has been designed to work in conjunction with HTML, it's easy to integrate it into existing HTML web pages.  It's even possible to switch between the two in the same page.  The exact proportion of HTML to PHP in a given page will vary depending on the purpose the designer intends for it.  Unless the user knows what to look for, it won't even be obvious that PHP is included in the page.

As long as you have an operating system and web server set up on your server, installing PHP is relatively easily.  You just have to install the processor, and teach the server to associate files with the .php extension with it.  The exact process will be different depending on what operating system you'll be installing PHP in conjunction with.  As soon as you have PHP installed, you only have to place .php files in your web directories.  The server will automatically parse them if someone points their browser to that page.

No matter what sort of dynamic web page you need, PHP programming can help you.  This language will run on almost any server, can be easily learned, and is inexpensive.  You can also often find free scripts that run in PHP to help you accomplish what you need for you page.  However, be sure to take care if you install someone else's script.  Their errors might seriously mess up your page.  Fortunately, if you can't find a script you trust, learning PHP programming is relatively easy.  There are many tutorials available online to help you understand the basics.  A simple web search is the place to start if you want to learn PHP programming.