This is my first time posting sorry if anything is wrong.
attached are my files in question but i don't know what is wrong. I want to show info from a .txt file or something similar within the website I'm working on. In AS3 it was easy to read and use an xml file but within html/php i cant remember. i want to be able to have to have the people im making the site for to be able to just update the text file and it will update the certain part of the site with the new information. Currently for some reason its commenting out part of my php code that i believe should read and echo the lines of the text file.
this is the php code:
<div id="home">
<h3>Updates From the Staff</h3>
<p>
<?php
$file = fopen("news.txt", "r") or exit("Unable to open file!");
while(!feof($file))
{
echo fgets($file). "<br>";
}
fclose($file);
?>
</p>
</div><!-- End Nav Home -->
this is what shows when i inspect element with chrome:
<!--?php
$file = fopen("news.txt", "r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
while(!feof($file))
{
echo fgets($file). "<br-->
its commenting out everything till the line brake and just showing
"; } fclose($file);
If someone could help me that would be amazing if not thats ok aswell.