Why did my PHP just stop working?
Several things I did all at once that may have broke it:
- Put jquery in without the jquery script included, but with jquery within javascript tags.
- Created a stylesheet (which was working, but then I added a :before style and jquery and the php stopped working).
- Changed white space within PHP code.
- Put
<!DOCTYPE HTML>at top, but then removed it and no change.
I expect a list of every folder and subfolder, but get a page with just the title, and Chrome shows me the php tags are within HTML comments (not sure if normal, never had php just not work).
Issue was: filetype not ANSI.
PHP:
<?php
function listFolderFiles($dir){
$ffs = scandir($dir);
echo '<ol>';
foreach($ffs as $ff){
if($ff != '.' && $ff != '..'){
echo '<li>'.$ff;
if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff);
echo '</li>';
}
}
echo '</ol>';
}
?>
HTML:
<html>
<head>
<title>
</title>
<?php include("find.php"); ?>
</head>
<body>
<h2>Folders</h2>
<?php listFolderFiles('../');?>
</body>
</html>
I believe your file is saved other than ANSI, because PHP cannot run on an UNICODE file.
try to open your file with your favorite editor and when you save … make sure you save it as ANSI.