Download - HTML & PHP
![Page 1: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/1.jpg)
HTML & PHP
What’s the difference?
![Page 2: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/2.jpg)
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
![Page 3: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/3.jpg)
HTML required keywords
<html></html> <head></head> <title></title> <body></body>
![Page 4: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/4.jpg)
HTML example – Hello World
<html>
<head>
<title>Here is the Title</title>
</head>
<body>
Hello World!
</body>
</html>
• Blank lines and spaces are ignored
![Page 5: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/5.jpg)
HTML common keywords
<div></div> <table></table> <p></p> <form></form> <br /> <img /> <a></a>
![Page 6: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/6.jpg)
Subfiles to Tables
<table> …subfile data … </table>
_ keyboard $12.95
_ Mouse $19.95
<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>
![Page 7: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/7.jpg)
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>
![Page 8: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/8.jpg)
PHP
Pre-Hypertext Processor The programming language (logic) Non-Compiled Stand Alone or imbedded in HTML All PHP files must end in .php
![Page 9: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/9.jpg)
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
![Page 10: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/10.jpg)
PHP not RPG
Free Format (RPG 2 / 3) Non-Compiled Dynamically Typed Variables $var Tags <?php ?> C Style end lines “;”
![Page 11: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/11.jpg)
PHP example<?php
echo “Hello World”;
?>
<?php
$variable = “Hello World”;
echo $variable;
?>
![Page 12: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/12.jpg)
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>
![Page 13: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/13.jpg)
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…
![Page 14: HTML & PHP](https://reader036.vdocument.in/reader036/viewer/2022072013/56812b12550346895d8f04da/html5/thumbnails/14.jpg)
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