SlideShare una empresa de Scribd logo
1 de 12
What is PHP?
PHP is an HTML-embedded scripting language. The
 goal of the language is to allow web developers to
 write dynamically generated pages quickly.
PHP will allow you to:
 Reduce the time to create large websites it’s an Open
  Source Software.
 Create a customized user experience for visitors
  based on information that you have gathered from
  them
What You Should Know
Before starting this tutorial it is important that you have
 a basic understanding and experience in the
 following:
HTML - Know the syntax and especially HTML forms.
Basic programming knowledge - This isn't required,
 but if you have any traditional programming
 experience it will make learning PHP a great deal
 easier.
PHP Syntax
 Syntax: The rules that must be followed to write
  properly structured code
 You can put your PHP code inside the body of HTML
 The PHP code is enclosed with
  <?php
    //your code here.
  ?>
example
<html>
<head>
 <title>Hello in PHP</title>
</head>
<body>
  <h1>Hello in PHP</h1>
      <? echo "Hello, world!“; ?>
</body>
</html>
Example 2: HTML & PHP
<html>
 <head>
 <title>My First PHP Page</title>
 </head>
 <body>
 <?php
      echo "Hello World!";
 ?>
 </body>
 </html>
PHP - Variables
 A variable is a means of storing a value, such as text string "Hello
   World!" or the integer value 4. A variable can then be reused
   throughout your code, instead of having to type out the actual value,
   over and over again.
   In PHP you define a variable with the following form:
Example:
   $variable_name = Value;
Description:
If you forget that dollar sign at the beginning and the semi-colon at the
   end, it will not work. This is a common mistake for new PHP
   programmers!
Outputting a String.
 PHP
<?php
        echo "Hello!";
        echo "<h5>I love using PHP!</h5>";
?>
 Output
  Hello!
  I love using PHP!
Using Comment in PHP
 Comments in PHP are similar to comments that are used
  in HTML. A comment is started with a special character
  sequence and all text that appears between the start of the
  comment and the end will be ignored by the browser.
 Single Line Comment
  // this a single line statement
 Multiple Line Comment
        /* this is a multiple
           line comment.
        */
Creating HTML form
<html><body>
  <h4>ABC Art Supply Order Form</h4>
  <form>
  <select>
        <option>Paint</option>
        <option>Brushes</option>
        <option>Erasers</option>
  </select>
  Quantity: <input type="text" />
  <input type="submit" />
  </form>
  </body></html>
Output
PHP Form Processor
<html>
<body>
  <?php
  $quantity = $_POST['quantity'];
  $item = $_POST['item'];
  echo "You ordered ". $quantity . " " . $item . ".<br />";
  echo "Thank you for ordering from ABC Art Supplies!";
  ?>
  </body>
</html>

Más contenido relacionado

La actualidad más candente

Javascript alert and confrim box
Javascript alert and confrim boxJavascript alert and confrim box
Javascript alert and confrim box
Jesus Obenita Jr.
 
Intro 1 sept_14_2010
Intro 1 sept_14_2010Intro 1 sept_14_2010
Intro 1 sept_14_2010
Andrey L
 
Html journal chris kweks (microbold)
Html journal   chris kweks (microbold)Html journal   chris kweks (microbold)
Html journal chris kweks (microbold)
Chris Kwekowe
 
Chapter1 introduction it2
Chapter1 introduction it2Chapter1 introduction it2
Chapter1 introduction it2
Kinglan Galon
 
Pre production
Pre productionPre production
Pre production
Cika7
 

La actualidad más candente (16)

Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Javascript alert and confrim box
Javascript alert and confrim boxJavascript alert and confrim box
Javascript alert and confrim box
 
Popup boxes
Popup boxesPopup boxes
Popup boxes
 
Phpwebdevelping
PhpwebdevelpingPhpwebdevelping
Phpwebdevelping
 
Php notes 01
Php notes 01Php notes 01
Php notes 01
 
Browser As Platform
Browser As PlatformBrowser As Platform
Browser As Platform
 
What are the Benefits of Learning HTML code?
What are the Benefits of Learning HTML code?What are the Benefits of Learning HTML code?
What are the Benefits of Learning HTML code?
 
Intro 1 sept_14_2010
Intro 1 sept_14_2010Intro 1 sept_14_2010
Intro 1 sept_14_2010
 
Html journal chris kweks (microbold)
Html journal   chris kweks (microbold)Html journal   chris kweks (microbold)
Html journal chris kweks (microbold)
 
Learn html in 30mins
Learn html in 30minsLearn html in 30mins
Learn html in 30mins
 
Chapter1 introduction it2
Chapter1 introduction it2Chapter1 introduction it2
Chapter1 introduction it2
 
Html lecture1
Html lecture1Html lecture1
Html lecture1
 
Pre production
Pre productionPre production
Pre production
 
Xhtml
XhtmlXhtml
Xhtml
 
Semantics & the Mobile Web
Semantics & the Mobile WebSemantics & the Mobile Web
Semantics & the Mobile Web
 
Php web development
Php web developmentPhp web development
Php web development
 

Destacado

Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison poster
vscr429
 
Prepositions mini lesson_esl502[1]
Prepositions mini lesson_esl502[1]Prepositions mini lesson_esl502[1]
Prepositions mini lesson_esl502[1]
vscr429
 
Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison poster
vscr429
 
Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison poster
vscr429
 

Destacado (19)

Why companies need to work agile ?
Why companies need to work agile ?Why companies need to work agile ?
Why companies need to work agile ?
 
Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison poster
 
Prepositions mini lesson_esl502[1]
Prepositions mini lesson_esl502[1]Prepositions mini lesson_esl502[1]
Prepositions mini lesson_esl502[1]
 
Aula10
Aula10Aula10
Aula10
 
Level Design Technology Forecast
Level Design Technology ForecastLevel Design Technology Forecast
Level Design Technology Forecast
 
Agile for startup success
Agile for startup successAgile for startup success
Agile for startup success
 
S.t.a.r.
S.t.a.r.S.t.a.r.
S.t.a.r.
 
Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison poster
 
Life at GDC - Tech Forum Presentation
Life at GDC - Tech Forum PresentationLife at GDC - Tech Forum Presentation
Life at GDC - Tech Forum Presentation
 
S.t.a.r.
S.t.a.r.S.t.a.r.
S.t.a.r.
 
Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison poster
 
S.t.a.r.
S.t.a.r.S.t.a.r.
S.t.a.r.
 
S.t.a.r.
S.t.a.r.S.t.a.r.
S.t.a.r.
 
Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison poster
 
Aula1 2016
Aula1 2016Aula1 2016
Aula1 2016
 
Mm1 mmc
Mm1 mmcMm1 mmc
Mm1 mmc
 
Working time regulations
Working time regulationsWorking time regulations
Working time regulations
 
Gamification - MDWEgypt 2016
Gamification  - MDWEgypt 2016Gamification  - MDWEgypt 2016
Gamification - MDWEgypt 2016
 
Prepositions mini lesson_esl502[1]
Prepositions mini lesson_esl502[1]Prepositions mini lesson_esl502[1]
Prepositions mini lesson_esl502[1]
 

Similar a Php (20)

Php tizag tutorial
Php tizag tutorialPhp tizag tutorial
Php tizag tutorial
 
PHP learning
PHP learningPHP learning
PHP learning
 
php_tizag_tutorial
php_tizag_tutorialphp_tizag_tutorial
php_tizag_tutorial
 
Php tizag tutorial
Php tizag tutorial Php tizag tutorial
Php tizag tutorial
 
Php tizag tutorial
Php tizag tutorialPhp tizag tutorial
Php tizag tutorial
 
PHP.docx
PHP.docxPHP.docx
PHP.docx
 
Php
PhpPhp
Php
 
Php
PhpPhp
Php
 
Php
PhpPhp
Php
 
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
 
Basic php 5
Basic php 5Basic php 5
Basic php 5
 
PHP
PHPPHP
PHP
 
Php1
Php1Php1
Php1
 
Php
PhpPhp
Php
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
 

Último

Último (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Php

  • 1.
  • 2. What is PHP? PHP is an HTML-embedded scripting language. The goal of the language is to allow web developers to write dynamically generated pages quickly.
  • 3. PHP will allow you to:  Reduce the time to create large websites it’s an Open Source Software.  Create a customized user experience for visitors based on information that you have gathered from them
  • 4. What You Should Know Before starting this tutorial it is important that you have a basic understanding and experience in the following: HTML - Know the syntax and especially HTML forms. Basic programming knowledge - This isn't required, but if you have any traditional programming experience it will make learning PHP a great deal easier.
  • 5. PHP Syntax  Syntax: The rules that must be followed to write properly structured code  You can put your PHP code inside the body of HTML  The PHP code is enclosed with <?php //your code here. ?>
  • 6. example <html> <head> <title>Hello in PHP</title> </head> <body> <h1>Hello in PHP</h1> <? echo "Hello, world!“; ?> </body> </html>
  • 7. Example 2: HTML & PHP <html> <head> <title>My First PHP Page</title> </head> <body> <?php echo "Hello World!"; ?> </body> </html>
  • 8. PHP - Variables  A variable is a means of storing a value, such as text string "Hello World!" or the integer value 4. A variable can then be reused throughout your code, instead of having to type out the actual value, over and over again. In PHP you define a variable with the following form: Example: $variable_name = Value; Description: If you forget that dollar sign at the beginning and the semi-colon at the end, it will not work. This is a common mistake for new PHP programmers!
  • 9. Outputting a String.  PHP <?php echo "Hello!"; echo "<h5>I love using PHP!</h5>"; ?>  Output Hello! I love using PHP!
  • 10. Using Comment in PHP  Comments in PHP are similar to comments that are used in HTML. A comment is started with a special character sequence and all text that appears between the start of the comment and the end will be ignored by the browser.  Single Line Comment // this a single line statement  Multiple Line Comment /* this is a multiple line comment. */
  • 11. Creating HTML form <html><body> <h4>ABC Art Supply Order Form</h4> <form> <select> <option>Paint</option> <option>Brushes</option> <option>Erasers</option> </select> Quantity: <input type="text" /> <input type="submit" /> </form> </body></html> Output
  • 12. PHP Form Processor <html> <body> <?php $quantity = $_POST['quantity']; $item = $_POST['item']; echo "You ordered ". $quantity . " " . $item . ".<br />"; echo "Thank you for ordering from ABC Art Supplies!"; ?> </body> </html>