What the heck is PHP?

Technically, PHP is a server-side, cross-platform, HTML embedded scripting language, also called a hypertext preprocessor. If that's a little confuisng, don't worry- we'll make it a little easier to understand.

PHP is:
  • Server-side, because it is processed by the server before being sent as HTML code to the browser, similar to CGI or ASP.

  • Cross-platform, because it works with any OS platform.

  • HTML-embedded, because it can be inserted anywhere in HTML code, although an entire site can also be done solely by using PHP.

    PHP origonated as a Perl hack, and was written by Rasmus Lerdorf in 1994. It soon evolved into what we know today as PHP. The letters "PHP" stood for Lerdorf's Personal Home Page utility. The syntax is mainly patterned after C, with some elements borrowed from Perl, C++ and Java. But don't that scare you, it is only patterned after the above, and not nearly as hard to learn.

    If you are a programmer, you will find PHP to be very easy to learn, and if you are not a programmer, you can still easily learn enough to transform your site from static plain-Jane HTML to a dynamic and interactive format.

    How PHP Works:

    The easiest way to understand how PHP works is with an example:

    <?php print "Hello, User!"; ?>

    To break it down, the characters '<?php' tell the browser to expect a PHP script. The middle part is self explanatory, and the final tag '?>' tells the browser "That's the end of the script". The above code will be processed by the server and then sent to the user's browser as plain HTML, with this result:

    Hello, User!

    So why bother, you may say? Can't HTML do the same thing?

    Yes, of course it can, and the example above is only used to explain how it works in a very general way. Instead of printing text, a variable could be used to greet a member of a forum by their name, or to pass variables from one page to another, or to tell the webmaster what page a user was viewing when they used an email link. There are also far more useful reasons to use PHP, to name just a few here:

  • A single template can be used to generate all the headers, menus and footers of the whole website, greatly reducing your workload when making modification and updates.
  • All of Sitebilder's hosting packages come with the Zend engine and Optimizer, which 'supercharges' the output of your code.
  • Using PHP classes such a 'gzdoc' and others, a page 70kb in size can be compressed and cached on the server before being sent to the browser by as much as 50%, substantially reducing the load time. One of the pages on this site is 82kb, including images and SWF, and is compressed to just 31kb.

    PHP is arguably the hottest new thing on the web now, with over 3,000,000 websites already using it. It affords the advantages of ASP, server-side JavaScript, or CGI scripting, and is faster than CGI and much easier to learn than any of them.

    Sound good? Then keep an eye out for some mini tutorials on basic PHP which I intend to begin putting up soon, as I have the time. And there will also be a few PHP scripts that you can use, added to the Free Stuff section periodically.



    [Printer Friendly Page]



    Copyright © 1998 - 2017 Bill Payne & Sitebilder© Network