INTRODUCTION
LESSONS
MORE PHP
|
01 - Text Output Using PHP
Hello World!
As far as possible, PHP processing (business rules) should be carried out
before the <head> tag on a web page. In the <body> of the
page, there should only be echo, include and other output statements.
Homework: Write your own
version of the "Hello World!" program. It should display several
pieces of text and should include formatting tags such as headings and
paragraphs.
<!-- Here is the page source code for 01hello.php -->
<?php
include "code.php"; // Contains the function used to display
// the source code of web pages.
$helloMessage = "<h3>Hello World!</h3>";
?>
<html>
<head>
<title>Text Output Using PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table border="1" cellpadding="4" cellspacing="0">
<tr valign="top">
<td><?php include "nav.php"; ?></td>
<td>
<h1>01 - Text Output Using PHP</h1>
<?php echo $helloMessage; ?>
<p> As far as possible, PHP processing (business rules) should be carried out
before the <head> tag on a web page. In the <body> of the
page, there should only be echo, include and other output statements.</p>
<p><strong><font color="#FF0000">Homework:</font></strong> Write your own
version of the "Hello World!" program. It should display several
pieces of text and should include formatting tags such as headings and
paragraphs.</p>
<?php dump_page("01hello.php"); ?>
</td>
</tr>
</table>
</body>
</html>
|
|