Question: I have designed a website in php language. I have a search box in my website. Now i want to make it usable means that if a user wants to search anything he could just type there and can get the desired result. Is this necessary to use php or it could be happened easily with HTML tags???

Answer: 
the best thing is that you should use google search
implementing google search is not that hard. you have to provide information about your site and a script will generate which you have to put on your html page
**this is the php code for a searchbar** 

 HOME

 html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, input, textarea, fieldset, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin:0; padding:0; border:0; outline:0; }

```
$keyword=trim($_POST["keyword"]); 

//check if the keyword is empty 

if($keyword==""){ 

echo"no keywords"; 

exit; 

} 

//With above, you can give hints to your users when they forget to enter a keyword. Now let's go through all the files or articles in your website. 

function listFiles($dir){ 

$handle=opendir($dir); 

while(false!==($file=readdir($handle))){ 

if($file!="."&&$file!=".."){ 

//if it is a directory, then continue 

if(is_dir("$dir/$file")){ 

listFiles("$dir/$file"); 

} 

else{ 

//process the searching here with the following PHP script 

} 

} 

} 

} 

//The following scripts read, process files and check whether the files contain $keyword. If $keyword is found in the file, the file address will be saved in an array-type variable. 

function listFiles($dir,$keyword,&$array){ 

$handle=opendir($dir); 

while(false!==($file=readdir($handle))){ 

if($file!="."&&$file!=".."){ 

if(is_dir("$dir/$file")){ 

listFiles("$dir/$file",$keyword,$array); 

} 

else{ 

//read file 

$data=fread(fopen("$dir/$file","r"),filesize("$dir/$file")); 

//avoid search search.php itself 

if($file!="search.php"){ 

//contain keyword? 

if(eregi("$keyword",$data)){ 

if(eregi("(.+)",$data,$m)){ 

$title=$m["1"]; 

} 

else{ 

$title="no title"; 

} 

$array[]="$dir/$file $title"; 

}

} 

} 

} 

} 

} 

//define array $array 

$array=array(); 

//execute function 

listFiles(".","php",$array); 

//echo/print search results 

foreach($array as $value){ 

list($filedir,$title)=split("[ ]",$value,"2"); 

echo "$value"."
\n"; 

}  
        ?>
hello
</body>
</html>

```