SlideShare uma empresa 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>

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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]
 

Semelhante 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

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Último (20)

Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 

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>