I am extremely knew to working with databases and servers and just downloaded MAMP. I have a website I made in html and css and want to inject a php script to it. I have saved the file in .php and when I navigate to it from the localhost port on my browser, none of the html is displayed. It only shows a blank white page. There is probably a really obvious answer but I've been searching google for an hour and haven't found a solution.
This is the php script. It is wrapped in a
tag everything else in the document is html.
<?PHP
$filelocation = "Text.txt";
if (!file_exists($filelocation)) {
echo "Couldn't find datafile, please contact the administrator.";
}
else {
$newfile = fopen($filelocation,"r");
$content = fread($newfile, filesize($filelocation));
fclose($newfile);
}
$content = stripslashes($content):
$content = htmlentities($content):
$content = nl2br($content);
echo $content;
?>