Lesson 1 : Getting to know PHP [part 1]

November 27, 2008

In this lesson you will find out what php is all about and see what it is able to do.

PHP Basics

PHP is a programming language that was designed for creating dynamic websites. it slots into your web server and processes instructions contained in a web page before that page is sent through to your web browser. Certain elements of the page can therefore be generated on the fly so that the page changes each time it is loaded. For instance, you can use PHP to show the current date and time at the top of each page in your site, as you’ll see later in this lesson.

The name PHP is a recursive acronym that stands for PHP: Hypertext Preprocessor. It began life called PHP/FI, the “FI” part standing for Forms interpreter . Though the name was  shortened a while back, one of the PHP’s most powerful features is how easy it becomes to process data submitted in HTML forms. PHP can also talk to various database systems, giving you the ability to generate a web page based on SQL query.

For example you could enter a search keyword into a form field on web page, query a database with this value, and produce a page of matching results. You will have seen this kind of application many times before, at virtually any online store as well as many websites that do not sell anything, such as search engines.

The PHP language is flaxible and fairly forgiving, making it easy to learn even if you have not done any in the past . if you already know another language, you will almost certainly find similarities here. PHP looks like a cross between C, Perl and Java, and if you with any of these, you will find that you can adapt you existing programming style to PHP with little effort.

Server-Side Scripting

The most important concept to learn when you starting out with PHP is where exactly it fits into the grand scheme of things in a web enviroment.

When you understand this, you will understand what PHP can and can’t do.

The PHP module attaches to web server, telling it that files with a particular extention should be examined for PHP code. Any PHP code found in the page is executed – with any PHP code replaced by the outputit produces – before the web page is sent to the browser.

To be countinue ….. part 2 .

Advertisements