io ho fatto così ma non riesco a far si che cerci anche nelle sottocartelle:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento senza titolo</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="index.php">
<div align="center">
<input type="text" name="find" />
<input type="submit" name="Submit" value="cerca" />
</div></form>
<?php
if(isset($_POST['find'])){
$find=$_POST['find'];
//vede se ci sono cartelle
$dir = "./files";
$d = dir($dir);
$tot=0;
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != ".htaccess" && $file != ".htpasswd") {
$pos = strpos($file, $find);
if($pos===false){
}else{echo ($file."
");}
}
}
closedir($handle);
}
}
?>
</body>
</html>

Rispondi quotando