Please send questions to
st10@humboldt.edu .
<html>
<!-- files5.php
by: Sharon Tuttle
last modified: 12-05-06
-->
<head>
<title> playing with PHP and files - 5 </title>
</head>
<body>
<h2> playing with PHP and files - 5 </h2>
<h3>
<?php
$writeHandle = fopen("logFile.txt", "a")
or exit("Cannot open logFile.txt for appending");
// add a line with the current date and time to this file
fwrite( $writeHandle, ( date('r') . "<br>\n" ) );
fclose( $writeHandle );
// what is in logFile.txt now?
$logFile_contents = file_get_contents("logFile.txt");
print "<h3>\n";
print "$logFile_contents";
print "</h3>\n";
?>
</h3>
</body>
</head>