PHP stands for Hypertext Preprocessor and is a server-side language. This means that when a visitor opens the page, the server processes the PHP commands and then sends the results to the visitor’s browser, just as with ASP. A typical PHP files will content commands to be executed in the server in addition to the usual mixture of text and HTML (Hypertext Markup Language) tags. However, PHP is Open Source and cross-platform. PHP runs on Windows NT and many Unix versions, and it can be built as an Apache module and as a binary that can run as a CGI.
When you type an URL in the Address box or click a link on a Web page, you’re asking a Web server on a computer somewhere to send a file to the Web browser on your computer. If that file is a normal HTML file, it looks exactly the same when your Web browser receives it as it did before the Web server sent it. After receiving the file, your Web browser displays its contents as a combination of text, images, and sounds. In the case of a PHP page, the process is similar, except there’s an extra processing step that takes place just before the Web server sends the file. Before the Web server sends the PHP file to the Web browser, it runs all server-side scripts contained in the page.
PHP’s language syntax is similar to C’s and Perl’s. You don’t have to declare variables before you use them, and it’s easy to create arrays and hashes (associative arrays). PHP even has some rudimentary object-oriented features, providing a helpful way to organize and encapsulate your code. Beyond its basic syntax, PHP also boasts a wide range of interfaces allowing it to communicate with everything from other web pages, to databases including ODBC, and other programming languages such as Java or COM. PHP goes right into your Web pages, so there’s no need for a special development environment or IDE. You start a block of PHP code with <?php and end it with ?>.
What can you do with PHP?
There are many things you can do with PHP. You can display date, time, and other information in different ways. You can make a survey form and ask people who visit your site to fill it out. With PHP it is possible to access over 19 different types of databases and manipulate data within those databases based on input from the user via a web page. You can also send e-mail, work with newsgroups,etc.
If you don’t already have a copy of PHP, you can download it at the official Web site.