I have a web page that has a folder on it say "folder1" that contains powerpoint files(.ppt). What i want to do is make a search box for someone to be able to enter say a specific name of a file and then when they hit submit it will search folder1 for that name of the file or related key words and return the file as a clickable link. Can anyone help me out with this?

if (file_exists($path)) {

//or loop through files
foreach (glob("*.txt") as $filename) {
    echo "$filename size " . filesize($filename) . "\n";
}
Member Avatar for rajarajan2017
if (file_exists($_POST['file'])) { 
        echo 'File exists!';
		echo '<br/>To view the content Click on the Link: ';
		echo '<a href='.$_POST['file'].'>'.$_POST['file'].'</a>';
        } 
    else { 
        echo 'File does not exist!'; 
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.