PHP

PHP is an open-source, server-side scripting language that's similar to ASP. PHP code can also be embedded in HTML pages, such as the following that displays a text message:

<html>
<head>
<title>Embedding PHP</title>
</head>
<body>
<?php 
 echo "Welcome to my PHP page"; 
 ?>
</body>
</html>

The PHP code in this HTML page is run on the server. HTML is sent to the client, but, similar to ASP, you can't view the server source code that generated the HTML.

To use PHP, you need a server that supports PHP and that'll run files with a .php file extension. You can use a Web host that supports PHP, or you can test PHP locally by installing both PHP and a Web server that supports PHP on your computer. IIS supports PHP; Apache is also a popular open-source Web server that includes PHP support. It can be downloaded for free from the Apache Software Foundation. Download the latest version of PHP.

The main advantages of PHP are as follows:

  • It can be used on all the major operating systems
  • It supports a wide range of databases
  • It can output images, PDFs, and media files as well as HTML
  • It includes sophisticated text processing features

You can also do the following with PHP:

  • Process forms data from HTML forms.
  • Make dynamic changes to HTML pages.
  • Access a database and return information to an HTML page.

MySQL (http://www.mysql.com/downloads/index.html) is an open-source database that's often used with PHP.

For more information on PHP, see: