SlideShare a Scribd company logo
HOW

PHP
WORKS ?



          Content Copyright to Dreamsoft k. Tamil selvan
Client
                User requests a PHP page or a HTML page that includes a PHP
                Script                                                                       Web Server
Hello world I   Via HTTP.
am a PHP Code
                  Server responds to the request by sending the generated
                  HTML page to the User.                                                                    <html>
                                                                                                            <head>
                                                                                                               <title> PHP to
                                                                                                            HTML</title>
                                                                                                            </head>
                                                                                                            <body>
                                                                                                                   <h1> Hello world
                                                                                                            I am a PHP
                                                                                                            Code </h1>
                                            If a PHP page is requested, server passes                       </body>
                                            the PHP page to the PHP script engine.                          </html>

                                             #hello world PHP script.
                                                                                                            The    PHP       engine
                                             <?php
                                                                                                            parses the given
                                             echo ‚<h1> Hello World I am a PHP                              PHP      script    and
                                             Code</h1>‛;                                                    Converts it into HTML
                                             ?>
                                                                                                            And send’s it to the
                                                                                                            browser as shown
                                                                                                            Above.
                                                                                     PHP SCRIPT ENGINE




                                                                                 Content Copyright to Dreamsoft k. Tamil selvan
Client
           User requests a PHP page or a HTML page that includes a PHP
           Script                                                                            Web Server
Robinson   Via HTTP.

             Server responds to the request by sending the generated
             HTML page to the User.                                                                       <html>
                                                                                                          <head>
                                                                                                             <title> PHP to
                                       If a PHP page is requested, server passes
                                                                                                          HTML</title>
                                       the PHP page to the PHP script engine.                             </head>
                                                                                                          <body>
                                       #DataBase PHP script.                                                   <h1> Robinson</h1>
                                       <?php                                                              </body>
                                       $q = ‘SELECT fn FORM persons’;                                     </html>
                                       //run the query
                                       $r = mysqli_query($dbc, $q);
                                       //fetch the data
                                       While($re = mysqli_fetch_array($r)){
                                           echo ‚<h1>{$re[‘fn’]}</h1>‛;                                   The    PHP       engine
                                       }                                                                  parses the given
                                       ?>                                                                 PHP      script    and
                                                                                                          Converts it into HTML
                                                                                                          And send’s it to the
                               PHP engine send’s the query to the MySQL DB engine.                        browser as shown
                               (SELECT fn FROM persons);                                                  Above.
                                                                                     PHP SCRIPT ENGINE


                                  Returns the result of the query (Robinson)
              DATABASE
                                                                               Content Copyright to Dreamsoft k. Tamil selvan

More Related Content

What's hot

Php unit i
Php unit iPhp unit i
Php unit i
BagavathiLakshmi
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
Lorna Mitchell
 
Linux, Apache, Mysql, PHP
Linux, Apache, Mysql, PHPLinux, Apache, Mysql, PHP
Linux, Apache, Mysql, PHP
webhostingguy
 
Cgi
CgiCgi
Develop webservice in PHP
Develop webservice in PHPDevelop webservice in PHP
Develop webservice in PHP
Sanil Subhash Chandra Bose
 
html
htmlhtml
html
tumetr1
 
PHP And Web Services: Perfect Partners
PHP And Web Services: Perfect PartnersPHP And Web Services: Perfect Partners
PHP And Web Services: Perfect Partners
Lorna Mitchell
 
Intro to Dynamic Web Pages
Intro to Dynamic Web PagesIntro to Dynamic Web Pages
Intro to Dynamic Web Pages
Jussi Pohjolainen
 
php 1
php 1php 1
php 1
tumetr1
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
Zoran Jeremic
 
Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5
Michael Girouard
 
CGI Presentation
CGI PresentationCGI Presentation
CGI Presentation
Sopan Shewale
 
Java servlets and CGI
Java servlets and CGIJava servlets and CGI
Java servlets and CGI
lavanya marichamy
 
Common Gateway Interface ppt
Common Gateway Interface pptCommon Gateway Interface ppt
Common Gateway Interface ppt
OECLIB Odisha Electronics Control Library
 
Cgi
CgiCgi
Introduction to nu soap
Introduction to nu soapIntroduction to nu soap
Introduction to nu soap
vikash_pri14
 
CGI Introduction
CGI IntroductionCGI Introduction
CGI Introduction
Chaffey College
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentation
Annujj Agrawaal
 
Jsp slides
Jsp slidesJsp slides
Jsp slides
Kumaran K
 
Common gateway interface
Common gateway interfaceCommon gateway interface
Common gateway interface
Anandita
 

What's hot (20)

Php unit i
Php unit iPhp unit i
Php unit i
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Linux, Apache, Mysql, PHP
Linux, Apache, Mysql, PHPLinux, Apache, Mysql, PHP
Linux, Apache, Mysql, PHP
 
Cgi
CgiCgi
Cgi
 
Develop webservice in PHP
Develop webservice in PHPDevelop webservice in PHP
Develop webservice in PHP
 
html
htmlhtml
html
 
PHP And Web Services: Perfect Partners
PHP And Web Services: Perfect PartnersPHP And Web Services: Perfect Partners
PHP And Web Services: Perfect Partners
 
Intro to Dynamic Web Pages
Intro to Dynamic Web PagesIntro to Dynamic Web Pages
Intro to Dynamic Web Pages
 
php 1
php 1php 1
php 1
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
 
Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5
 
CGI Presentation
CGI PresentationCGI Presentation
CGI Presentation
 
Java servlets and CGI
Java servlets and CGIJava servlets and CGI
Java servlets and CGI
 
Common Gateway Interface ppt
Common Gateway Interface pptCommon Gateway Interface ppt
Common Gateway Interface ppt
 
Cgi
CgiCgi
Cgi
 
Introduction to nu soap
Introduction to nu soapIntroduction to nu soap
Introduction to nu soap
 
CGI Introduction
CGI IntroductionCGI Introduction
CGI Introduction
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentation
 
Jsp slides
Jsp slidesJsp slides
Jsp slides
 
Common gateway interface
Common gateway interfaceCommon gateway interface
Common gateway interface
 

Similar to How php works

How to Use PHP in HTML.pdf
How to Use PHP in HTML.pdfHow to Use PHP in HTML.pdf
How to Use PHP in HTML.pdf
CIOWomenMagazine
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
GiyaShefin
 
introduction_php.ppt
introduction_php.pptintroduction_php.ppt
introduction_php.ppt
ArunKumar313658
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
MercyL2
 
Php
PhpPhp
Web server scripting - Using a form
Web server scripting - Using a formWeb server scripting - Using a form
Web server scripting - Using a form
John Robinson
 
Intro to-php-19 jun10
Intro to-php-19 jun10Intro to-php-19 jun10
Intro to-php-19 jun10
Kathy Reid
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
SHARANBAJWA
 
Phpbasics
PhpbasicsPhpbasics
Phpbasics
PrinceGuru MS
 
Lecture8
Lecture8Lecture8
Lecture8
Majid Taghiloo
 
Web architecture
Web architectureWeb architecture
PHP
PHPPHP
php basics
php basicsphp basics
php basics
NIRMAL FELIX
 
Php
PhpPhp
Web Development Course: PHP lecture 2
Web Development Course: PHP lecture 2Web Development Course: PHP lecture 2
Web Development Course: PHP lecture 2
Gheyath M. Othman
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
adeel990
 
Day1
Day1Day1
Day1
IRWAA LLC
 
Introduction to web development
Introduction to web developmentIntroduction to web development
Introduction to web development
Muhammad Shafiq
 
Php
PhpPhp
WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
HambardeAtharva
 

Similar to How php works (20)

How to Use PHP in HTML.pdf
How to Use PHP in HTML.pdfHow to Use PHP in HTML.pdf
How to Use PHP in HTML.pdf
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
 
introduction_php.ppt
introduction_php.pptintroduction_php.ppt
introduction_php.ppt
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
 
Php
PhpPhp
Php
 
Web server scripting - Using a form
Web server scripting - Using a formWeb server scripting - Using a form
Web server scripting - Using a form
 
Intro to-php-19 jun10
Intro to-php-19 jun10Intro to-php-19 jun10
Intro to-php-19 jun10
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
Phpbasics
PhpbasicsPhpbasics
Phpbasics
 
Lecture8
Lecture8Lecture8
Lecture8
 
Web architecture
Web architectureWeb architecture
Web architecture
 
PHP
PHPPHP
PHP
 
php basics
php basicsphp basics
php basics
 
Php
PhpPhp
Php
 
Web Development Course: PHP lecture 2
Web Development Course: PHP lecture 2Web Development Course: PHP lecture 2
Web Development Course: PHP lecture 2
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
 
Day1
Day1Day1
Day1
 
Introduction to web development
Introduction to web developmentIntroduction to web development
Introduction to web development
 
Php
PhpPhp
Php
 
WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
 

How php works

  • 1. HOW PHP WORKS ? Content Copyright to Dreamsoft k. Tamil selvan
  • 2. Client User requests a PHP page or a HTML page that includes a PHP Script Web Server Hello world I Via HTTP. am a PHP Code Server responds to the request by sending the generated HTML page to the User. <html> <head> <title> PHP to HTML</title> </head> <body> <h1> Hello world I am a PHP Code </h1> If a PHP page is requested, server passes </body> the PHP page to the PHP script engine. </html> #hello world PHP script. The PHP engine <?php parses the given echo ‚<h1> Hello World I am a PHP PHP script and Code</h1>‛; Converts it into HTML ?> And send’s it to the browser as shown Above. PHP SCRIPT ENGINE Content Copyright to Dreamsoft k. Tamil selvan
  • 3. Client User requests a PHP page or a HTML page that includes a PHP Script Web Server Robinson Via HTTP. Server responds to the request by sending the generated HTML page to the User. <html> <head> <title> PHP to If a PHP page is requested, server passes HTML</title> the PHP page to the PHP script engine. </head> <body> #DataBase PHP script. <h1> Robinson</h1> <?php </body> $q = ‘SELECT fn FORM persons’; </html> //run the query $r = mysqli_query($dbc, $q); //fetch the data While($re = mysqli_fetch_array($r)){ echo ‚<h1>{$re[‘fn’]}</h1>‛; The PHP engine } parses the given ?> PHP script and Converts it into HTML And send’s it to the PHP engine send’s the query to the MySQL DB engine. browser as shown (SELECT fn FROM persons); Above. PHP SCRIPT ENGINE Returns the result of the query (Robinson) DATABASE Content Copyright to Dreamsoft k. Tamil selvan