I have a list of items drawn from a file on my server.
I'm hiding certain filenames as you can see in my code, but the variable i'm using "$filelist" is only hiding the last value in the array instead of all the values.
As you can see in the image below A15 and A17 should be hidden, but only A17 is.
How can I use $filelist to hide all the values within it, rather than only the last one?
while ($row = mysql_fetch_assoc($result)) {
$filelist = $row["file"];
echo "<input type=\"checkbox\" value=\"$filelist\" name=\"files[]\" checked=\"checked\"/> $filelist<br />";
}
echo "<br>";
$dirname = "/var/www/vhosts/hub.gkrmaintenance.co.uk/public_html/forms/templates";
$forms = scandir($dirname);
sort($forms);
foreach ($forms as $file) {
if(($file != ".") and
($file != "..") and
($file != "index.php") and
($file != "Site Induction Sheet.docx") and
($file != "Method Statement Complete.docx") and
($file != "Construction Phase Plan Complete.docx") and
($file != "Method Statement.docx") and
($file != "Construction Phase Plan.docx") and
($file != $filelist))
{
echo "<input type=\"checkbox\" value=\"$file\" name=\"files[]\" /> $file<br />";
}
}