is web-design-savvy;
I'm trying to make a search tool that looks up and displays files in a folder. The code that I'm currently (below) only works if you enter the EXACT name of the file in the search box. Does anyone know how to make changes to make the tool display files with only part of the file name?
<?php
$dir = "myfolder";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if($file == $_POST['SEARCHBOX_INPUT']){
echo('<a href="'.$dir . $file.'">'. $file .'</a>'."\n");
}
}
closedir($dh);
}
}
?>
I wonder if there's a single group aimed at what you want 🤔
Обсуждают сегодня