Developer Forums | About Us | Site Map
Search  
HOME > TUTORIALS > SERVER SIDE CODING > PHP TUTORIALS > INTRODUCTION TO PHP


Sponsors





Useful Lists

Web Host
site hosted by netplex

Online Manuals

Introduction to PHP
By Joe "Zonker" Brockmeier - 2003-12-29 Page:  1 2 3 4

Dynamic vs. Static Content

What's so hot about dynamic content? Let's say you're managing an e-commerce site with 10 products. It's not that difficult to hand-code ten static product pages with all the requisite information, forms and such, provided your products don't change often and you don't anticipate much growth. However, let's say you add ten more products this month, and then more next month, and occasionally prices change or you want to change the look and feel of your site. Then you're stuck re-coding dozens, maybe hundreds, of static pages by hand.

On the other hand, let's say you start by creating one page that is called product.php. Instead of holding static information, it's coded to pull information out of your product database and build a page dynamically. You then have one meta page that can serve up one or one hundred or even a hundred thousand unique pages based on information stored in a database. Rather than requiring a Web master to spend an entire day doing nothing but monkey-work updating static Web pages, the information can now be updated at the same time the information is changed in the company database. You eliminate the headache-inducing lag between the time information is changed in the database and the time it makes its way onto the Web site.

At the risk of generalizing, for work on the Web, PHP is a great way to go. It's not the only way to go; Perl, Java, JavaScript, ASP, Python, Tcl, CGIs, and probably dozens of other ways are available for generating dynamic content. However, PHP has the benefit of being designed just for Web-based problems and of being an open source project.

If you're looking for a programming language for a word processor or 3D game, then PHP probably isn't the way to go. If you need to run a Web site with dynamic content, database interaction, and e-commerce, read on, because PHP is going to be very helpful indeed.

Platforms available for PHP

The most common PHP installation is probably the PHP module running with Apache on Linux or a UNIX-variant. But if you're using something else, don't worry. PHP works on Windows NT and 9x, as well as with a number of other Web servers. You'll find more documentation floating around on the Web that's specific to the Apache/Linux/PHP combo, but it isn't by any means the only platform that PHP is supported on.

Licensing and use

How much might you pay for a full-featured embedded Web scripting language? How about nothing? PHP is an open source project, so there are no licensing fees or restrictions on use. You could run a small, non-profit site, or you could run a billion-dollar e-commerce site with PHP, and the cost is the same: zero. Not only that, but the PHP code is available in case you want or need to tweak it.

PHP is not licensed under the GPL, but its own license permits redistribution of code and/or binaries.



View Introduction to PHP Discussion

Page:  1 2 3 4 Next Page: Using PHP

First published by IBM developerWorks


Copyright 2004-2017 GrindingGears.com. All rights reserved.
Article copyright and all rights retained by the author.