Tuesday, 25 March 2014

Creating & executing Simple php program

  • It contains FOUR steps. These are as follows.

    1.       Download WAMP server:-

    As php is server side scripting language, we require server to run php program. There are various servers available to run php program. We can use XAMPP, WAMP server. In this tutorial we are going to use WAMP server. To download WAMP server click here.


    2.       Install WAMP server:-

    You can double click on WAMP server set up file. It will start installing. Install WAMP server using default setting. By default it will install under C:\wamp directory.

    Then we have to start wamp server & then put it online. Click on the shortcut of WampServer, then wamp server automatically start. If WampServer is Offline then put it Online. It can be understood by following picture.

    Put WAMP server Online

    3.      To check WampServer Online or not:-


    Go to browser you are using. Then type http://localhost or http://127.0.0.1 . If the WampServer is active then it will show following window else it will display error message. This can be better understood from following picture.

    Show Proper working of WAMP Server

    4.       Write php Program:-

    To write php code we can use any text editor. I’m using Notepad for this. Write simple php code to display “Welcome in the World of PHP”. We write code as follows & save in C:\wamp\www directory. (If you are using XAMPP server then save php files under C:\xampp\htdocs . Rest of the process is as it is.) Save this file as Nikhil.php . Always use .php as extension to save PHP file. This can be well understood using following picture.

    How to Save PHP Program
     

    5.       Run php Page:-


    Go to Browser. In address bar type http://localhost/File_Name.php . In my case Nikhil is File_Name. Then press enter. You will see “Welcome, to the world of php”. It can be shown in following picture. 

    Output of Simple PHP Program



    Waiting for your feedback.Thanks. In next article I've explain Simple Login page in PHP using MySQL. To see this click here.


4 comments:

  1. how to access to data base and inser information from <form

    ReplyDelete
  2. http://marathaprogrammer.blogspot.in/2014/04/login-page-authentication-program-in-php.html
    .
    You must see above article to get information of database interaction of PHP with MySQL.

    ReplyDelete