X

Rate Us :



Share with Friends :

Menu

Steps to create and execute PHP Programs :


  • Step-1 : Open Editor and implement PHP script using script declaration style tags.

  • Step-2 : Save this file in the root directory (htdocs inside the XAMPP) with extension '.php'

  • Step-3 : Open XAMPP control panel & start Apache server.

  • Step-4 : Open Browser and send the request to the server (by writting : localhost/file_name in your browser) to get the output of PHP file.

  • Declaration style tag of PHP :

    PHP is providing different types of declaration style tags -

    Universal Style Tag :-

    This tag supports all functionality.

    <?php......?>


    Short Open Tag :-

    This tag supports very few functionality.

    <?............?>


    ASP Style Tag :-

    We can add PHP script within ASP declaration syntax.

    <%............%>


    Script Style Tag :-

    It is similar to JavaScript declaration syntax.

    <script language="php">

    .............................

    .............................

    </script>



    We have to configuration setting in php.ini related to declaration style tag. The default value is 'OFF' for short open tags & ASP tags. By changing the value we can execute these tags. We need to restart the server to see the changes.