I saw wappy has added  file search on his wap buddy script at http://cult.trap17.com  Help me to create this script./Or give me a wap file search script..Hard Style,wappy plz help.. 
							
						
					 
							
						 
		
	
	
	
	 
							
						?php
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
echo "\n";
echo "<wml>";
echo "<head>
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
</head>"; 
echo "<card newcontext=\"true\" title=\"search\">";
echo "<p mode=\"nowrap\">\n";
echo "[size="1"]\n";
function search($target, $directory){
   if(is_dir($directory)){
       $direc = opendir($directory);
       while(false !== ($file = readdir($direc))){
           if($file !="." && $file != ".."){
               if(is_file($directory."/".$file)){
                   if(preg_match("/$target/i", $file)){
$size = round(filesize($directory."/".$file)/1024,1);
$rev = strrev ($file);
$exp = explode (".", $rev);
$true = strrev ($exp[0]);
$trueext = strtolower ($true);
if ($trueext=="zip" OR $trueext=="rar" OR $trueext=="gz" OR $trueext=="wav" OR $trueext=="bmp" OR $trueext=="mid" OR $trueext=="midi" OR $trueext=="sis" OR $trueext=="bmp" OR $trueext=="wbmp" OR $trueext=="mmf" OR $trueext=="png" OR $trueext=="jar" OR $trueext=="jad" OR $trueext=="exe" OR $trueext=="doc" OR $trueext=="mp3" OR $trueext=="mp4" OR $trueext=="3gp" OR $trueext=="avi" OR $trueext=="gif" OR $trueext=="jpg" OR $trueext=="jpeg" OR $trueext=="nth" OR $trueext=="thm" OR $trueext=="amr"){                                           
echo "»<a href=\"$directory/$file\">$file ($size KB)</a>
";}
                                       }
               }else if(is_dir($directory."/".$file)){
                   search($target,$directory."/".$file);
               }
           }
       }
       closedir($direc);
   }
   return;
}
echo "[b]Search Results: [/b]$search
---
";
search("$search", "./");
echo "---
[/size][size="1"]Search again:[/size]
<input title=\"SEARCH:\" emptyok=\"true\" name=\"q\"/>
[size="1"]
<a href=\"search.php?search=$(q)\">Search Files</a>
";
echo "---
<a href=\"http://topsite.6te.net\">TOP-SITE</a>
---
© TOP-SITE 2006-2007";
echo "[/size]\n";
echo "</p>";
echo "</card>";
echo "</wml>";
?>
 
		
	
	
	
	 [/b]
[/b]
			
		<?
header("Content-type: text/vnd.wap.wml"); 
echo "<?xml version=\"1.0\"?>"; 
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; 
include("../wapbuddy_settings.php");
if (!isset($page)) {$page = 0;}
$total = 0;
if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array(); 
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php" and $file != "search.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
?> 
<wml> 
<card id="card1" title="<? echo $conf["site_name"] ?>"> 
<p mode="nowrap">
<do type="option" label="Home"><go href="../index.php"/></do>
<? echo "<a href=\"../index.php\">Home</a>
"; ?>
<?
if ($file_count > 0)
{
$first_record = $page * $conf["items_per_page"];
$last_record = $first_record + $conf["items_per_page"];
while (list($fileIndexValue, $file_name) = each ($file_array))
{
if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{
echo "<a href=\"$file_name\">$file_name</a> (". round(filesize($file_name)/1024,1) . "kb)
";
$total = $total + filesize($file_name);
}
}
if (($file_count > 0) AND ($page != 0))
{
// previous button
$prev_page = $page -1;
echo "
<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">Prev</a>
";
}
if (($file_count > 0) AND ($last_record < $file_count))
{
// next button
$next_page = $page + 1;
echo "
<a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">Next</a>
";
}
echo "
Directory:
$file_count ";
if ($file_count == 1)
{echo "file";}
else
{echo "files";}
echo " (" . round($total/1024,1) . "kb)";
echo "
<a href=\"../index.php\">Home</a>";
}
closedir($dp);
?>
[size="1"]Search for FREE files:[/size]
<input title="SEARCH:" emptyok="true" name="q"/>
[size="1"]
[url="search.php?search=$(q)"]SEARCH[/url][/size]
page: $page
Pick a page
[b]To[/b]
[b]0-44434[/b]
<input type="text" name="page" title="1-34 pages only" maxlength="20" size="03" value=""/>[size="1"]
<anchor><go href="index.php" method="post"><postfield name="page" value="$(page)"/></go>[page]</anchor>[/size]
</p>
</card> 
</wml>
 
		
	
	
	
	 
		
	
	
	
	<?php
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
echo "\n";
echo "<wml>";
echo "<head>
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
</head>"; 
echo "<card newcontext=\"true\" title=\"search\">";
echo "<p mode=\"nowrap\">\n";
echo "[size="1"]\n";
function search($target, $directory){
   if(is_dir($directory)){
       $direc = opendir($directory);
       while(false !== ($file = readdir($direc))){
           if($file !="." && $file != ".."){
               if(is_file($directory."/".$file)){
                   if(preg_match("/$target/i", $file)){
$size = round(filesize($directory."/".$file)/1024,1);
$rev = strrev ($file);
$exp = explode (".", $rev);
$true = strrev ($exp[0]);
$trueext = strtolower ($true);
if ($trueext=="zip" OR $trueext=="rar" OR $trueext=="gz" OR $trueext=="wav" OR $trueext=="bmp" OR $trueext=="mid" OR $trueext=="midi" OR $trueext=="sis" OR $trueext=="bmp" OR $trueext=="wbmp" OR $trueext=="mmf" OR $trueext=="png" OR $trueext=="jar" OR $trueext=="jad" OR $trueext=="exe" OR $trueext=="doc" OR $trueext=="mp3" OR $trueext=="mp4" OR $trueext=="3gp" OR $trueext=="avi" OR $trueext=="gif" OR $trueext=="jpg" OR $trueext=="jpeg" OR $trueext=="nth" OR $trueext=="thm" OR $trueext=="amr"){                                           
echo "?<a href=\"$directory/$file\">$file ($size KB)</a>
";}
                                       }
               }else if(is_dir($directory."/".$file)){
                   search($target,$directory."/".$file);
               }
           }
       }
       closedir($direc);
   }
   return;
}
echo "[b]Search Results: [/b]$search
---
";
search("$search", "./");
echo "---
[/size][size="1"]Search again:[/size]
<input title=\"SEARCH:\" emptyok=\"true\" name=\"q\"/>
[size="1"]
<a href=\"search.php?search=$(q)\">Search Files</a>
";
echo "---
<a href=\"http://topsite.6te.net\">TOP-SITE</a>
---
? TOP-SITE 2006-2007";
echo "[/size]\n";
echo "</p>";
echo "</card>";
echo "</wml>";
?>
<?
header("Content-type: text/vnd.wap.wml"); 
echo "<?xml version=\"1.0\"?>"; 
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; 
include("../wapbuddy_settings.php");
if (!isset($page)) {$page = 0;}
$total = 0;
if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array(); 
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php" and $file != "search.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
?> 
<wml> 
<card id="card1" title="<? echo $conf["site_name"] ?>"> 
<p mode="nowrap">
<do type="option" label="Home"><go href="../index.php"/></do>
<? echo "<a href=\"../index.php\">Home</a>
"; ?>
<?
if ($file_count > 0)
{
$first_record = $page * $conf["items_per_page"];
$last_record = $first_record + $conf["items_per_page"];
while (list($fileIndexValue, $file_name) = each ($file_array))
{
if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{
echo "<a href=\"$file_name\">$file_name</a> (". round(filesize($file_name)/1024,1) . "kb)
";
$total = $total + filesize($file_name);
}
}
if (($file_count > 0) AND ($page != 0))
{
// previous button
$prev_page = $page -1;
echo "
<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">Prev</a>
";
}
if (($file_count > 0) AND ($last_record < $file_count))
{
// next button
$next_page = $page + 1;
echo "
<a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">Next</a>
";
}
echo "
Directory:
$file_count ";
if ($file_count == 1)
{echo "file";}
else
{echo "files";}
echo " (" . round($total/1024,1) . "kb)";
echo "
<a href=\"../index.php\">Home</a>";
}
closedir($dp);
?>
[size="1"]Search for FREE files:[/size]
<input title="SEARCH:" emptyok="true" name="q"/>
[size="1"]
[url="search.php?search=$(q)"]SEARCH[/url][/size]
page: $page
Pick a page
[b]To[/b]
[b]0-44434[/b]
<input type="text" name="page" title="1-34 pages only" maxlength="20" size="03" value=""/>[size="1"]
<anchor><go href="index.php" method="post"><postfield name="page" value="$(page)"/></go>[page]</anchor>[/size]
</p>
</card> 
</wml>
 
		
	
	
	
	 
		
	
	
	
	 
		
	
	
	
	?php
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
echo "\n";
echo "<wml>";
echo "<head>
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
</head>"; 
echo "<card newcontext=\"true\" title=\"search\">";
echo "<p mode=\"nowrap\">\n";
echo "[size="1"]\n";
function search($target, $directory){
   if(is_dir($directory)){
    $direc = opendir($directory);
    while(false !== ($file = readdir($direc))){
     if($file !="." && $file != ".."){
      if(is_file($directory."/".$file)){
       if(preg_match("/$target/i", $file)){
$size = round(filesize($directory."/".$file)/1024,1);
$rev = strrev ($file);
$exp = explode (".", $rev);
$true = strrev ($exp[0]);
$trueext = strtolower ($true);
if ($trueext=="zip" OR $trueext=="rar" OR $trueext=="gz" OR $trueext=="wav" OR $trueext=="bmp" OR $trueext=="mid" OR $trueext=="midi" OR $trueext=="sis" OR $trueext=="bmp" OR $trueext=="wbmp" OR $trueext=="mmf" OR $trueext=="png" OR $trueext=="jar" OR $trueext=="jad" OR $trueext=="exe" OR $trueext=="doc" OR $trueext=="mp3" OR $trueext=="mp4" OR $trueext=="3gp" OR $trueext=="avi" OR $trueext=="gif" OR $trueext=="jpg" OR $trueext=="jpeg" OR $trueext=="nth" OR $trueext=="thm" OR $trueext=="amr"){             
echo "»<a href=\"$directory/$file\">$file ($size KB)</a>
";}
            }
      }else if(is_dir($directory."/".$file)){
       search($target,$directory."/".$file);
      }
     }
    }
    closedir($direc);
   }
   return;
}
echo "[b]Search Results: [/b]$search
---
";
search("$search", "./");
echo "---
[/size][size="1"]Search again:[/size]
<input title=\"SEARCH:\" emptyok=\"true\" name=\"q\"/>
[size="1"]
<a href=\"search.php?search=$(q)\">Search Files</a>
";
echo "---
<a href=\"http://topsite.6te.net\">TOP-SITE</a>
---
© TOP-SITE 2006-2007";
echo "[/size]\n";
echo "</p>";
echo "</card>";
echo "</wml>";
?>
Comment