<html>
<head>
<title>Include Files</title>
</head>
<body bgcolor=lightyellow>
<h2>Include an html file</h2>
<br><br>
<?php
$now = time( ); //get current date and time
$hour = date("H", $now); //get the hour component
if ($hour < 12)
print "Good Morning."; //print it on the HTML page
else
echo "Good Afternoon."; //echo is the same as print
print " The current date and time is: ";
echo date("m/d/Y h:i:s A", $now); //print date using that format
?>
<?php
echo "<br><br><br>";
echo "<p>---The following is an HTML include file---</p>";
// include "include2.html";
include "/home/sultans/web/php/demo/2function/include2.html"; //use explicit name to make it work in PHP*Tester
echo "<p>---End of include---</p>";
?> <!-- include an html file -->
<?php include "../include.php"; ?> <!-- hyperlink to see the code -->
</body>
</html>