java2db

How to create and run a PHP file ( Simple example for PHP )



How to run a PHP file  What is PHP ( Introduction ) :

PHP (Hypertext Preprocessor) is a open source server side scripting language and it is especially suitable for web development (it can embedded into HTML) and very easy to learn.

PHP code starts eith <?php and ends with ?>.The PHP code executes in a web server and it generates a HTML output.
It supports either procedural programming or object oriented programming (OOP) or a mixture of them both.

PHP also has support to interact with other services using protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM.

 

 

How to run a PHP file  Requirements to run a PHP file:

 Web Server (download XAMPP server ). We used XAMPP server to run the below example.

 Web Browser (down Firefox browser ).

 

 

 Process to create and run a PHP file:

How to run a PHP file  Step 1 :

Download XAMPP server and install it in your local machine. It will open XAMPP Control Panel .

To start the server , click the (Apache) Start button.Now the server is running.

 

 

 Step 2 :

Open  Notepad and  copy the below (Example 1) PHP code.

Save it as Example.php under  C:\xampp\htdocs (server installation  location).

 

 
 Step 3 :

Open the web browser (Ex :Firefox,Chrome,IE) and type localhost/Example.php  in the address bar.Finally the response comes to the browser window as a HTML file.

 

 

 

Example 1:

Output :

Internally , the server generated HTML response code as follows ,

 

 
Example 2:

Output :

Internally , the server generated HTML response code as follows ,




Related Posts :
   [will not be published]



^ <