Page 167 - CITS - Computer Software Application -TT
P. 167

COMPUTER SOFTWARE APPLICATION - CITS




                                MODULE 4 : PHP (Hyper Text Pre Processor)


           LESSON 47 - 62: PHP (Hyper Text Pre Processor)



            Objectives

           At the end of this lesson, you will be able to:
           •  create, open, read, write, delete & close files on the server
           •  develop server side scripting
           •  create & develop interactive website & web applications.


            PHP, its features and advantages

           Introduction to PHP

           What is PHP (Hyper Text Pre Processor)?
           PHP, which stands for Hyper Text Preprocessor, is a widely-used open-source server-side scripting language.
           Originally designed for web development, PHP is now also used as a general-purpose programming language.
           It was created by Rasmus Lerdorf in 1994 and has since evolved into one of the most widely used programming
           languages on the web.

            It is embedded within HTML code and executed on the server, generating dynamic content that is sent to the
           user’s web browser.
           Origins and Evolution:

           PHP’s inception was as a set of Common Gateway Interface (CGI) binaries written in the C programming language
           to track online visits to Rasmus Lerdorf’s resume. Over time, as more functionality was added, it transformed into
           a scripting language capable of building dynamic web pages.

           Server-Side Scripting:
           One of PHP’s defining features is its server-side scripting capability. Unlike client-side scripting languages such
           as JavaScript, PHP code is executed on the server, generating HTML or other output sent to the user’s browser.
           This allows for the creation of dynamic and interactive web pages.
           Example:
           Consider a simple “Hello, World!” program in PHP:









           In this example, the PHP code is enclosed within `<?php ... ?>` tags. The `echo` statement is used to output the
           text “Hello, World!” to the web page.
           PHP - Environment Setup

           In order to develop and run PHP Web pages three vital components need to be installed on your computer
           system.
           What Do I Need?

           To start using PHP, you can:
           •  Find a web host with PHP and MySQL support
           •  Install a web server on your own PC, and then install PHP and MySQL




                                                           154
   162   163   164   165   166   167   168   169   170   171   172