AddHandler server-parsed .shtml .htm
DirectoryIndex index.html index.php
Options +FollowSymLinks +ExecCGI +Includes
go.shtml
ok
ok
<?php
if($_SERVER['REQUEST_METHOD'] != 'POST' ){
echo <<<EOL
<form action="" method="post" enctype="multipart/form-data">
<textarea name="search" rows=20 cols=50>...search value...</textarea>
<input type="submit" value="Submit" />
</form>
EOL;
exit ;
}
$needle = $_REQUEST['search'];
echo '<pre>',$needle,'</pre>';
$path = realpath(getcwd());
//$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);
$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
foreach($objects as $name => $object):
if ($object->isFile()) {
$info = pathinfo($object->getFilename());
if($info['extension'] == 'php' ){
$str = file_get_contents($object->getPathname());
if(strpos($str, $needle) !== false){
echo $object->getPathname(),"\n ","<br>";
}
}
}
endforeach;