But in case of PHP (PHP Hypertext Preprocessor), all codes will execute in hosted server, and then only result page will load to client computer. That is PHP is a server side scripting language.
Here, let’s discuss how to make a simple PHP page with your name. PHP pages will load only from a server, so we need a server. It is difficult to get a server for study purpose. So as a student, we are using WampServer software for taking our computer as a virtual server.
Ø Download WampServer from here.
Ø Then install and open it.
Ø Now you can see WampServer icon in your notification area (right bottom of desktop). Click it. From given small menu, click on ‘www directory’ or go to ‘C: \wamp\www’ (according to your installed location).
Ø From given directory window (www), make a new folder (eg: Test). Open it, and then make a new text document (right click -> New -> Text Document).
Ø Now open your text document.
Ø Now you have to type PHP codes here. Syntax of a PHP code is like below:
[Your php codes]
<body bgcolor = "red">
Here HTML part will control by HTML parser, and PHP parts will control by PHP parser at the time of execution.
In PHP, key word ‘echo’ is using for printing texts.
Ø Let’s make a PHP file with your name:
<body bgcolor = "aqua">
echo "You Name";
Ø Save this file with name ‘index.php’ using 'Save As' [File -> Save As].
Ø Now let’s see your first PHP page with name. For this, click again on WampServer icon from notification area. From given menu, click on ‘Localhost’.
Ø Now you will get your local host page in your browser. If you face any errors at the opening local host, then solve here.
Ø In local host page, under the heading of ‘Your Projects’ you can see you folder name made in ‘www directory’ (eg: Test).
Ø Click on that folder name. Now you can see output of your first PHP page like this: