html & php

14
HTML & PHP What’s the difference?

Upload: kyra-wilson

Post on 30-Dec-2015

24 views

Category:

Documents


0 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: HTML & PHP

HTML & PHP

What’s the difference?

Page 2: HTML & PHP

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

HTML required keywords

<html></html> <head></head> <title></title> <body></body>

Page 4: HTML & PHP

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

HTML common keywords

<div></div> <table></table> <p></p> <form></form> <br /> <img /> <a></a>

Page 6: HTML & PHP

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

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

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

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

PHP not RPG

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

Page 11: HTML & PHP

PHP example<?php

echo “Hello World”;

?>

<?php

$variable = “Hello World”;

echo $variable;

?>

Page 12: HTML & PHP

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

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

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