Home > General > How PHP Works

How PHP Works

When you go to a Web site (I’ll use http://www.DMCinsights.com/php/index.php as my example here), your Internet Service Provider directs your request to the server that holds the http://www.DMCinsights.com/php/index.php information. Because this site was designed in PHP, the server reads the PHP and processes it according to its scripted directions. In this example, the PHP code tells the server to send the appropriate Web page data to your browser. This data is in the form of HTML that the browser can display as it would a standard HTML page. In short, PHP creates an HTML page on the fly based on parameters of my choosing; the server contains no static HTML pages.

To the end user and their browser, there may not be an obvious difference between what http://www.DMCinsights.com/php/index.php and http://www.DMCinsights.com/php/index.html look like, but how the pages arrived at that point are critically different. The major difference: By using PHP, you can have the server dynamically generate the HTML code. In this example, the index.php page referenced above displays news items that it retrieves chronologically from a database.

Dynamic Web page creation is what sets apart the less appealing, static sites from the more interesting, and therefore more visited, interactive ones.

Categories: General
  1. November 14, 2007 at 2:38 am | #1

    Yep

  1. No trackbacks yet.