0
4.1kviews
Write short note on Building Web application using PHP.

Subject: Internet Programming

Topic: Server Side Programming: PHP

Difficulty: Low

1 Answer
1
103views

Building Web Application using PHP

  • PHP is a recursive acronym for "Hypertext Preprocessor" that earlier stood for Personal Home Pages.
  • PHP is a server side scripting language that is embedded in HTML. It can be used in combination with various web template systems, web content management system and web frameworks.
  • It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites.
  • It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.
  • In order to develop and run PHP Web pages we require Web Server, Database and PHP Parser.
  • The easiest way to install & run PHP on your own computer is using software like XAMPP. There are other similar software bundles like MAMP, WAMP NetBeans etc. that can install & run PHP, but: XAMPP works well in all the major Operating Systems like Windows, Mac & Linux the same way. So XAMPP is easier for beginners.
  • As we already know a Web application can be defined as an application that can be accessed through the Internet using a Web browser.
  • Web application process input data provided by users and displays the required information to the users. For example, the official websites of different banks provide information about clients and their accounts, in addition to allowing different transactions online.
  • Means it is an example of client-server based application that runs on a server and accessed by multiple client computers.
  • PHP is a scripting language that is used for creating such a Web applications.
  • PHP scripts can only be interpreted on a server that has PHP installed. The client computers accessing the PHP scripts require a web browser only.
  • The flowchart diagram shown below illustrates the basic architecture of a PHP Web application and how the server handles the requests.

    PHP Application

  • To get a feel of PHP, The program shown below is a basic PHP application that outputs the words “Hello World!” and displays the number series up to 5, when viewed in a Web browser.
  • As mentioned earlier, PHP is embedded in HTML. That means it is in amongst our normal HTML or XHTML.
  • A PHP file contains PHP tags and ends with the extension ".php". We'll have PHP statements like this:
 <html>
 <head>
 <title>Hello World</title>
 <body>
 <?php echo "Hello, World!<br><br>";
    for ($x = 0; $x <= 5; $x++) {
           echo "The number is: $x <br>";
   }
    ?>
 </body>
 </html>
  • If you examine the HTML output of the above example, you'll notice that the PHP code is not present in the file sent from the server to your Web browser. All of the PHP present in the Web page is processed and stripped from the page; the only thing returned to the client from the Web server is pure HTML output.
Please log in to add an answer.