lundi 29 juin 2015

Can't get php to display access.txt file in html

This may be a noob question. In which case, sorry. I can't get this php script to read the contents of a txt file in the same directory. It outputs




here is the code

$Color = "red";
$myFile = "access.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, 5);
echo '<div style="Color:'.$Color.'">'.$theData.'</div>';

Aucun commentaire:

Enregistrer un commentaire