Why Use PHP

I l @ ve RuBoard

Put simply, PHP is better, faster, and easier to learn than the alternatives. When designing Web sites, your primary alternatives to PHP are: simple HTML; CGI scripts (Common Gateway Interface, commonly, but not necessarily written in Perl); ASP (Active Server Pages); and JSP (Java Server Pages). JavaScript is not truly an alternative to PHP (or vice versa) as JavaScript is a client-side technology and cannot be used to create HTML pages in the same way that PHP or CGI can.

The advantage PHP has over basic HTML is that the latter is a limited system that allows for no flexibility or responsiveness. Visitors accessing HTML pages will see simple pages without any level of customization or dynamic behavior. With PHP, you can create exciting and original pages based upon whatever factors you want to consider (for example, the time of day or the user 's operating system). PHP can also interact with databases and files, handle email, and do many other things that HTML cannot.

Webmasters learned a long time ago that HTML alone will not produce enticing and lasting Web sites. To this end, server-side technologies such as CGI scripts have gained widespread popularity. These systems allow Web page designers to create Web applications that are dynamically generated, taking into account whichever elements the programmer desired. Often database-driven, these advanced sites can even be updated and maintained more readily than static HTML pages.

So the question is: Why should a Web designer use PHP instead of CGI, ASP, or JSP to make a dynamic Web site? First, PHP is both faster to program in and faster to execute than CGI scripts. I won't get into too much detail on the execution of these various processes (or open up a debate on the subject) but suffice it to say that compared to full programming languages, PHP is much easier to learn and use. People ”perhaps like you ”without any formal programming training whatsoever can be writing out PHP scripts with ease after reading just this one book. In comparison, ASP requires an understanding of VBScript, and CGI requires Perl (or C), and both of these are more complete languages, and, therefore, more difficult to learn.

Second, PHP was written specifically for dynamic Web page creation, whereas Perl (and VBScript and Java) were not, inferring that, by its very intent, PHP can do certain tasks faster and easier than its alternatives. I would like to make it clear, however, that while I'm suggesting PHP is definitely better for certain things (specifically those it was created to do) than CGI or ASP, PHP is not a better programming language than Java or Perl as they can do things PHP cannot.

My final argument for learning PHP is that once you do, and as its popularity continues to grow (it is already being used on nearly three million Web sites), you will find yourself well ahead of the learning curve on this, the latest " next big thing" in the world of Internet technology.

I l @ ve RuBoard


PHP for the World Wide Web (Visual QuickStart Guide)
PHP for the World Wide Web (Visual QuickStart Guide)
ISBN: 0201727870
EAN: 2147483647
Year: 2001
Pages: 116
Authors: Larry Ullman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net