1 / 14

HTML & PHP

HTML & PHP. What’s the difference?. HTML. Hypertext Markup Language Key Word is “Markup” HTML is the code that makes the “screen” All web pages are made of HTML HTML is not a programming language Files end in .html. HTML required keywords. <html></html> <head></head> <title></title>

kyra-wilson
Download Presentation

HTML & PHP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HTML & PHP What’s the difference?

  2. HTML • Hypertext Markup Language • Key Word is “Markup” • HTML is the code that makes the “screen” • All web pages are made of HTML • HTML is not a programming language • Files end in .html

  3. HTML required keywords • <html></html> • <head></head> • <title></title> • <body></body>

  4. HTML example – Hello World <html> <head> <title>Here is the Title</title> </head> <body> Hello World! </body> </html> • Blank lines and spaces are ignored

  5. HTML common keywords • <div></div> • <table></table> • <p></p> • <form></form> • <br /> • <img /> • <a></a>

  6. Subfiles to Tables • <table> …subfile data … </table> <table> <tbody> <tr><td>_</td><td>keyboard</td><td>$12.95</td></tr> <tr><td>_</td><td>Mouse</td><td>$19.95</td></tr> </tbody> </table>

  7. HTML advanced example <html> <head> <title>Advanced Example</title> </head> <body> <p>This text is in a paragraph</p> This text is not inside a paragraph. Neither is this. <p>But this text is</p> <div>And this text is in a Div tag</div> </body> </html>

  8. PHP • Pre-Hypertext Processor • The programming language (logic) • Non-Compiled • Stand Alone or imbedded in HTML • All PHP files must end in .php

  9. PHP and RPG • Both are easy to use for business logic • Both are procedural languages • Both can access iseries objects • Both run on the iseries • Both benefit from short acronyms

  10. PHP not RPG • Free Format (RPG 2 / 3) • Non-Compiled • Dynamically Typed • Variables $var • Tags <?php ?> • C Style end lines “;”

  11. PHP example <?php echo “Hello World”; ?> <?php $variable = “Hello World”; echo $variable; ?>

  12. PHP + HTML example <html> <head> <title>PHP + HTML example</title> </head> <body> <?php $variable = “Hello World!!!” ?> <p><?php echo $variable ?></p> <?php $variable = “Part 2” ?> <p><?php echo $variable ?></p> </body> </html>

  13. PHP conditionals • If($x == 2){ echo “x is equal to 2”; } • while($x < 3){ echo $x; $x++; } • foreach($array as $x){ echo $x; } • do{ echo $x; $x++; } while($x <= 10); • for… • switch…

  14. Try it out! • Go to your page and try creating and changing variables. • Change a variable from a string to an integer: • $var = “Hello World”; • echo $var; • $var = 501; • echo $var; • Test Paragraphs and line breaks

More Related