[HTML]<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="index.php">
<input name="Search_IN" type="text" id="Search_IN" maxlength="44" />
<input type="submit" name="SearchBTN" id="SearchBTN" value="Search" />
</form>[/HTML]
[PHP]<?php
$YourSearch=strtolower($_POST['Search_IN']);
$text=ucfirst($YourSearch);
if($_POST['SearchBTN']){
if(!ereg("^[a-zA-Z ]{4,44}$",$YourSearch)){
echo "Please Wright Rorrect Data";
exit;
}else{
echo "Your Search results for {$text} is :<br />";
if ($handle = opendir('../Search')) {
while (false !== ($file = readdir($handle))) {
if($file=="." || $file==".." || $file=="_notes" || $file=="Result.php" || $file=="index.php"){
//--------------------------------------------------------------
}else{
//get the files information
$All_Files .= $file."*";
$All_Files_Data=explode("*",$All_Files);
}
}
closedir($handle);
}
}
for($i=0;$i<count($All_Files_Data);$i++){
if(is_file($All_Files_Data[$i])){
if(strchr(strtolower(file_get_contents($All_Files_ Data[$i])),$YourSearch)){
echo "<a href='$All_Files_Data[$i]'>$All_Files_Data[$i]</a><br />";
}
}else if(is_dir($All_Files_Data[$i])){
echo "The dir is : {$All_Files_Data[$i]}<br />";
echo "<a href='$All_Files_Data[$i]'>$All_Files_Data[$i]</a><br />";
}
}
}
?>[/PHP]
[HTML]</body>
</html>[/HTML]
This code to search on my site but im having problem with the code,when the user search the site i need to tell the user if he did't fined any result.