allentech.net

Limited Time!
Totally FREE Web Design!
Click here!

Blue Host

Online Manual

Please see notice on manual index page, click here.

For support on demand visit our new support channel, TQ Support!

<< Chapter 17 - PHP3 and PHP4

Example PHP program


(Last modified Aug 26, 2002 )

A PHP program may be embedded directly into your HTML document file to create dynamic content in the page.

First, your document name must use a .php, .php3 or .phtml filename extension in order for the server to parse it correctly.

Next, all PHP code must be enclosed in tags that identify it as PHP code, like this:

<?php
//your code goes here
?>

To make a "Hello" program, copy and paste the following code into a file named hello.phtml and access it as any other web page from a PHP enabled server...

<html>
<head>
<title>Hello page</title>
</head>
<body>
<?php echo "<p> Hello cruel world!</p>"; ?>
</body>
</html>

Top