<span style="font-size:24pt;line-height:100%"><span style="font-size:14pt;line-height:100%">iam tryin to convert a search script fom wml to html please help the script aint that big but when it comes to html forms iam always in trouble
please help me</span> </span>
here the code for the search page ...(iam goin to use it wuth wapbuddy and the script is not mine )
please help me</span> </span>
here the code for the search page ...(iam goin to use it wuth wapbuddy and the script is not mine )
Code:
<?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://hsedan.x10hosting.com/wapbuddy/wapbuddy/wallpapers\">wallpapers</a>
---
nahsorhseda";
echo "[/size]\n";
echo "</p>";
echo "</card>";
echo "</wml>";
?>
Comment