PHP is a recursive acronym of Hypertext Preprocessor. PHP (Hypertext Preprocessor) was start out as a small open source project that evolve as more and more people found out how useful it was.
Hypertext Preprocessor is a server side scripting language which is use to create dynamic web pages. It is embedded with HTML and use to handle database, session tracking etc. An entire e-commerce site can be build in PHP.
PHP is compatible with maximum of current advance databases like Oracle, MySQL, Sybase, PostgreSQL, Microsoft SQL Server and Informix. All the advance and frequently use protocols like POP3, IMAP, and LDAP are support by PHP. It has very simple syntax same as of C programming language.
Common uses of PHP :
- PHP is use to handle file operations like create, open, read, write and close.
- It can accept data through form which is enter by the end user and save it on the server.
- Various operations like insert, update, delete and retrieval of data can be perform by PHP on the database.
- It can set and access cookies.
- PHP can set restrictions on access of certain web pages if necessary.
- Data encryption is possible using PHP.
Features/Advantages of PHP :
(1) Simple : PHP is very simple and easy to use scripting language. PHP mostly use syntax of C programming. The rules and regulations in PHP are simple to understand and follow.
(2) Interpreted : Rather than compilation, the PHP code is interpreted. There is no need of any Compiler.
(3) Faster : The execution speed of PHP is very fast as compare to other scripting languages like ASP (Active Server Pages) and JSP (Java Server Pages).
(4) Open Source : PHP is a n Open source. Means the software do not any license charges and it is totally free of cost. It is freely available on internet.
(5) Platform Independent : The PHP script can be execute on any machine irrespective of its platform. PHP can be execute on number of platforms like Linux, Unix, Mac OS and various windows operating systems.
(6) Efficiency : The efficiency of PHP is very good. It provides various advance features through OOPS concepts and also a rich set of function library which makes it efficient.
(7) Flexibility : It is very Flexible language. It can be easily embedded with HTML. All the HTML tags can be use in PHP with all their attributes. PHP can also integrate with other scripting languages like JavaScript or VBScript.
PHP Script Working :
To run PHP Script, we require Web Server. Web server is a software which delivers the web pages to the end users. When URL of a PHP Script is given in the address bar of web browser, a message is sent to the web server to send the HTML file related to the given URL. The web server sends the HTML files as a response. The web browser receives the file, read it and display the web page.
When a link is click by the user, a request for a file is send. When the user clicks on the submit button of a form, the web server processes the file. As a request is send for PHP file, the Web Server executes the PHP file and sends the resultant output in HTML form to the browser.
Precisely, when we install PHP, the configuration of web server is in such a way that it expect specific file extensions which contain PHP language statements. Usually these extensions are .php or .phtml, but any other extension can also be used.
Whenever a request is receive by the Web Server, it sends the HTML statements as it is by applying the tags but the PHP statements are process and output is generate. Then, only the generated output is sent in response to the client request.
The PHP statements which do not generate any output are now send to the browser. Hence, the PHP code cannot be seen by the end user.