$search = trim($_POST['search']);
if($search)
{
$search = trim($_POST['search']);
$strSearch = strtolower($search);
print "Search results for
$search
";
$files = glob("*.*");
$count = 0;
for ($i=0; $i
") != 0)
{
$start=strpos($buffer,"title");
$end=strpos($buffer,"/title");
if ($start != false && $end != false)
{
$start += 6;
$sTitle= substr($buffer2, $start, ($end-$start-1));
}
else
$sTitle = $sFile;
if(@substr_count(@substr($buffer, 5, @strlen($buffer)-6), $strSearch) > 0)
$bFlag = true;
}
if (@substr_count($buffer, '");
if ($start != false && $end != false)
$body= substr($page, $start, $end);
$body = strip_tags($body);
$body = strtolower($body);
if (@substr_count($body, $strSearch) > 0)
$bFlag = true;
}
}
if ($bFlag == true)
{
$count ++;
?>
if ($sTitle != "")
{
echo substr($sTitle, 0, 80)."...";
}
?>
if ($sDesc != "")
echo substr($sDesc, 0, 200)."...
";
?>
}
@fclose($handle);
}
if ($count == 0)
{
echo "No Record Found. Please try again with different keyword.";
}
}
else
{
echo "Blank query";
}
?>
$fnt= count($files);
echo " Total $count results found, from $fnt files.";
?>