Monday, 7 December 2015

INTRODUCTION TO PHP




  • PHP stands for Hypertext Preprocessor.
  • PHP is a server-side scripting language like ASP.
  • PHP scripts are executed on the server.
  • PHP supports many database(MYSQL,Informix,Oracle,Sybase,Solid,PostgreSQL,Generic ODBC, etc.)
  • PHP is open sourec software
  • PHP is free to download and use.
  • PHP is server-side scripting language, which can be embedded in HTML or used as a stand-alone.
  • PHP is an offical module of Apache HTTP Server.
  • PHP used to dynamic content database, ecommerce sire & application tool.
  • POP3,IMAP,LDAP and a large number of major protocols support PHP.







What is it used for ?

  • PHP is used for dynamic website development.

      Static Website          vs               Dynamic Website

            HTML CSS                                              HTML CSS or Something like PHP.





  • The full-form of PHP is :

             Hypertext Preprocessor

  • A bit weird full form though !


Client - Server Architecture


















Definition of PHP

  • PHP is a server-side scripting language.


History of PHP

  • It was created in 1995 by Rasmus Lerdorf.
  • Back in the day every bit of web programming was CGI scripts; PHP was a relief.
  • Those days its full form was Personal Home Page.
  • He kept a few things in mind while creating PHP:
    • The C Lahguage Syntax
    • The Simplicity.
    • The Flexibility
    • Then Two big companies came:
      • Facebook 
      • Yahoo

    Why PHP ?

    • Programmer's Perspective 
      • Its based on C Language Syntax
      • Its Simple to use
      • Its Flexible in its approach
      • Facebook and Yahoo like sites are made in it.
    • Business Perspective
      • Its Open Source






                            

    Tuesday, 21 July 2015

    How to install Wamp Server

    1.  Download WAMP Server 

         I'll give you simple steps for 'Installation of WAMP Server'. We need to download the WAMP Server Package .exe file from official WAMP Server Page. Choose file with Config of your system.


    after selection your file . It'll ask following Popup.Don't worry about this . Just click 'you can download it directly '


      2. Start Setup Wizard
            
             you'll get below Setup Wizard window, When you Run WAMP Server .exe file . It shows config of WAMP . Click 'Next' button to continue.


    You should agree the license of WAMPServer before Installation of WAMP Server.

     

     3. Select Destination and Icon
         Here, You should select the Server Location. Most of the server installing into C drive only. Me too installing into C drive . You can browse any other location and click 'Next'.


     And choose which Icons you want.


    4. Installing and Complate
        In 'Ready to Install' window, just click 'Install' button.

     

     Now wait up-to finish the installing.

     

     In following window,just leave Default value and Click 'Next'


    Now Installation Process is almost done. Tic the Launch and Finish it.

     
     5. Run WAMP Server
         Just double click the WAMP Server icon. You'll get following small icon in TAskBar. First it;s color is Red and change to Orange. At-last it goes to Green color. If green color comes, Your WAMP Server running successful.


     
     Now see your WAMP Server Home Page with following URL 'http://localhost/'.

     



    How to Install DreamWeaver on your System

    There are step-by-step instructions on how to install Adobe Dreamweaver CS4 version on your computer.

    You can download the Adobe Dreamweaver CS4 Trial version from the Macromedia/Adobe official web site.

    if you have already purchased the full version of Adobe Dreamweaver CS4, You can enter its serial number at the initial installation screen.


    Next, you should agree to the Adobe Software License Agreement.


    Once you have done that, follow the instructions in the setup program in order to finish the installation of Adobe DreamweaverCS4.

    Monday, 20 July 2015

    How to Declare Variable in PHP

    Step:1 Open Dreamweaver.

    Step:2 Create PHP Page




    Step:3 Coding ..

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?php
       $x=5;
       $y=6;
       echo"<center><h3> A=$x </h3></center>";
       echo"<center><h3> B=$y </h3><center>";
       $z=$x+$y;
       echo "<center><h2> Ans=$z</h2></center>";
    ?>
    </body>

    </html>


    Step:4 Save it on C drive=> wamp folder => www folder => name your folder

    Step:5 To Run Open wampmanager= > local host



    Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.


    How to Declare Static Variable in PHP

    Step:1 Open Dreamweaver.

    Step:2 Create PHP Page.




    Step:3 Coding ..

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    /* Static Scope
    When a function is completed, all of its variables are normally deleted. However, sometimes you want a local variable to not be deleted.

    To do this, use the static keyword when you first declare the variable: */

    <?php
    function myTest()
    {
        static $x=0;
        echo "<center>$x</center>";
        $x++;
    }

    myTest();
    myTest();
    myTest();

    ?>
    </body>

    </html>

    Step:4 Save it on C drive=> wamp folder => www folder => name your folder

    Step:5 To Run Open wampmanager= > local host


    Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.


    How to Declare Local Variable in PHP

    Step:1 Open Dreamweaver.

    Step:2 Create PHP Page




    Step:3 Coding ..

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>

    /* Local Scope
    A variable declared within a PHP function is local and can only be accessed within that function: */

    <?php

    $x=5;   //global scope

    function myTest()
    {
         echo $x;   //local scope
    }

    ?>
    </body>

    </html>

    Step:4 Save it on C drive=> wamp folder => www folder => name your folder

    Step:5 To Run Open wampmanager= > local host


    Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.




    Global Example in PHP

    Step:1 Open Dreamweaver.

    Step:2 Create PHP Page.




    Step:3 Coding ..

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    /* Global Scope
    A variable that is defined outside of any function, has a global scope.

    Global variables can be accessed from any part of the script, EXCEPT from within a function.

    To access a global variable from within a function, use the global keyword: */

    <body>

    <?php

    $x=5; // global scope
    $y=10; // global scope

    function myTest()
    {
          global $x,$y;
          $y=$x+$y;
    }

    myTest();
    echo "<br><center><h2>$y</h2></center></br>"; // outputs 15

    ?>
    </body>

    </html>


    Step:4 Save it on C drive=> wamp folder => www folder => name your folder.

    Step:5 To Run Open wampmanager= > local host.



    Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.