Wml To Html

Started on the old forum in November 2007 · view the original in the archive · old links redirect here

1 reply · 626 views · started 19 years ago · 1 min read

Guest #1

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

here the code for the search page ...(iam goin to use it wuth wapbuddy and the script is not mine )

<?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>";
?>
Guest #2
<?php
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo "\n";
echo "<html>";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\"/></head>"; 
echo "<body>";
echo "<title>Search</title>";
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"]
<form action=\"search.php\" method=\"get\">
Search again:[/size]

<input title=\"SEARCH:\" emptyok=\"true\" name=\"search\"/>
[size="1"]
<input value=\"Search Files\" type=\"submit\"/>
<small>
</form>";

echo "---
<a href=\"http://hsedan.x10hosting.com/wapbuddy/wapbuddy/wallpapers\">wallpapers</a>
---
nahsorhseda";
echo "[/size]\n";
echo "</p>";
echo "</body>";
echo "</html>";
?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close