this code is a basic read and react script.
the whole file is read into $buff.
If the word happy is fount then happy.html will be shown, otherwise it will be sad.html
If you provide more detail I'll provide a more detailed reply.
Cheers
<?php
$fp = fopen ("myfile.txt", "r")
{
while (!feof($fp)) {
read in 512 chars at a time
$buff. = fgets ($fp, 512);
}
}
fclose ($fp);
$buff now contains whole file
if (strstr($buff, "happy")) {
$fname = "happy.html";
}
else {
$fname = "sad.html";
}
$pt = fopen ($fname, "r");
fpassthru($pt);
fclose($pt);
?>