Need Help converting this script to WML...
Code:
<?php
include("../wap/core.php");
include("../wap/config.php");
connectdb();
$uip = getip();
$action = $_GET["action"];
$sid = $_GET["sid"];
$page = $_GET["page"];
$who = $_GET["who"];
$uid = getuid_sid($sid);
$sid = $_GET["sid"];
$site = $_GET["site"];
$sitename = "Mobile69";
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html"/>
<meta http-equiv="Cache-Control" content="no-cache" forua="true"/>';
echo "<title>$sitename Upload Files</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"http://mobile69.freehostia.com/web/style/style.css\"/>";
echo "</head>";
echo "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" vlink=\"#800080\">";
if ($upload="upload"&&$superdat_name){
if (!eregi("\.(mid|gif|bmp|mid|midi|3gp|mp3|wav|jar|jad|jpeg|jpg|sis|mmf|amr|png|wbmp)$",$superdat_name)){
print "[b]Unsupported File Extention![/b]";
}else{
$superdat_name = preg_replace(
'/[^a-zA-Z0-9\.\$\%\'\`\-\@\{\}\~\!\#\(\)\&\_\^]/'
,'',str_replace(array(' ','%20',"'"),array('_','_', ""),$superdat_name));
if(strlen($superdat_name)>53){ print "[b]File Name Is Too Long![/b]";
}else{
if (empty($superdat)) {
print "[b]No input file specified!!![/b]";
}else{
copy("$superdat", "files/$superdat_name") or
die("Couldn't copy file.");
echo "[b]$superdat_name[/b] has successfully been uploaded to our uploader";
echo "you can Now put this link in the Gallery
";
echo "[b]http://mobile69.freehostia.com/uploaded/files/$superdat_name[/b]";
}
}
}
}
?>
<?php
echo "<FORM align=\"center\" ACTION=\"upload.php?sid=$sid\" METHOD=\"POST\" ENCTYPE=\"multipart/form-data\">";
?>
[b]Select File To Be Uploaded :[/b]
<input align="center" type="file" name="superdat">
<input align="center" type="hidden" name="upload" value="upload"/>
<INPUT align="center" TYPE=SUBMIT NAME="submit" VALUE="Upload File!">
</small>
[b][u]You can only upload files with folowing extentions:[/u][/b]
.jpg, .jpeg, .gif, .png, .bmp, wbmp
----------
</FORM>
<?php
if($site=="wap"){
echo "
<a href=\"../wap/index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
}else{
echo "
<a href=\"../web/index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
}
?>
</body>
</html>
Comment