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

Why companies need to work agile ?
Why companies need to work agile ?Why companies need to work agile ?
Why companies need to work agile ?Mona Shokrof
 
Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison postervscr429
 
Prepositions mini lesson_esl502[1]
Prepositions mini lesson_esl502[1]Prepositions mini lesson_esl502[1]
Prepositions mini lesson_esl502[1]vscr429
 
Level Design Technology Forecast
Level Design Technology ForecastLevel Design Technology Forecast
Level Design Technology ForecastPralie Dutzel
 
Agile for startup success
Agile for startup successAgile for startup success
Agile for startup successMona Shokrof
 
Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison postervscr429
 
Life at GDC - Tech Forum Presentation
Life at GDC - Tech Forum PresentationLife at GDC - Tech Forum Presentation
Life at GDC - Tech Forum PresentationPralie Dutzel
 
Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison postervscr429
 
Language comparison poster
Language comparison posterLanguage comparison poster
Language comparison postervscr429
 
Working time regulations
Working time regulationsWorking time regulations
Working time regulationsStewart Spence
 
Gamification - MDWEgypt 2016
Gamification  - MDWEgypt 2016Gamification  - MDWEgypt 2016
Gamification - MDWEgypt 2016Mona Shokrof
 
Prepositions mini lesson_esl502[1]
Prepositions mini lesson_esl502[1]Prepositions mini lesson_esl502[1]
Prepositions mini lesson_esl502[1]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

Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
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 PerformanceSamy Fodil
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideStefan Dietze
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 

Último (20)

Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
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
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 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>