What is PHP: A Brief Introduction

PHP is a programming language for building dynamic, interactive Web sites. As a general rule, PHP programs run on a Web server, and serve Web pages to visitors on request. One of the key features of PHP is that you can embed PHP code within HTML Web pages, making it very easy for you to create dynamic content quickly.

What is Dynamic and Static Web Site

A dynamic Web page is a page whose contents can change automatically each time the page is viewed. Contrast this with a static Web page, such as a simple HTML file, which looks the same each time it’s displayed.

What is Interactive Web Site

An interactive Web site is a site that responds to input from its visitors.

  • A Web forum is a good example — users can post new messages to the forum, which are then displayed on the site for all to see.
  • Another simple example is a “contact us” form, where visitors interact with the page by filling out and sending a form, which is then emailed to the
    Webmaster.

PHP stands for PHP: Hypertext Preprocessor, which gives you a good idea of its core purpose: to process information and produce hypertext (HTML) as a result. (Developers love recursive acronyms, and PHP: Hypertext Preprocessor is a good example of one.)

PHP – Server-Side Scripting Language

PHP is a server-side scripting language, which means that PHP scripts, or programs, usually run on a Web server. The process of running a PHP script on a Web server looks like this:

  1. A visitor requests a Web page by clicking a link, or typing the page’s URL into the browser’s address bar. The visitor might also send data to the Web server at the same time, either using a form embedded in a Web page, or via AJAX (Asynchronous JavaScript And XML).
  2. The Web server recognizes that the requested URL is a PHP script, and instructs the PHP engine to process and run the script.
  3. The script runs, and when it’s finished it usually sends an HTML page to the Web browser, which the visitor then sees on their screen.

PHP – A Powerful Web Scripting Language

The interesting stuff happens when a PHP script runs. Because PHP is so flexible, a PHP script can carry out any number of interesting tasks, such as:

  • Reading and processing the contents of a Web form sent by the visitor
  • Reading, writing, and creating files on the Web server
  • Working with data in a database stored on the Web server
  • Grabbing and processing data from other Web sites and feeds
  • Generating dynamic graphics, such as charts and manipulated photos

PHP – A Great Choice for Web Applications

  • Web forums that allow visitors to post messages and discuss topics
  • Search engines that let people search the contents of a Web site or database
  • Straw poll scripts that enable visitors to vote in polls and surveys
  • Content management systems and blogs, which enable Webmasters to create sites easily with minimal technical knowledge
  • Webmail applications, allowing people to send and receive email using their Web browser
  • Online stores, allowing shoppers to purchase products and services over the Internet