Converting Problem

Started on the old forum in April 2008 · view the original in the archive · old links redirect here

14 replies · 831 views · started 18 years ago · 1 min read

3 participants
busterkeaton10 Developer · 68 posts #1

Need Help converting this script to WML... External image (may be gone)

<?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>
alesh Lead · 604 posts #2

U cannot! At least i thnk tht upload form cant b converted 2 wml...

eeeeerrr....

alesh Lead · 604 posts #7

pmpl we posted that at the same time lol, yeh yu cant convert the form into wml

yeah but i was faster than u lol

btw

busterkeaton10 Posted Today, 12:30 PM i just want to try this to WML...

read it again:

YOU can NOT

eeeeerrr....

Guest #10

here its converted good luck getting ti to work but

<?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";

header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php

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 "<go href=\"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

----------
</go></anchor>
";
<?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>";
}
echo "
  </p>
</card>";

?>

</wml>
alesh Lead · 604 posts #11

Wtf is tht? A mix of wml nd xhtml 2gether? Lol

eeeeerrr....

Guest #12

you can not upload file using wml only using xhtml you can upload file how ever you can copy files from other sites using the copy file script

busterkeaton10 Developer · 68 posts #13

you can not upload file using wml only using xhtml you can upload file how ever you can copy files from other sites using the copy file script

you mean via copying the link? i hate that cause my max.php wont open a picture outside my site!

<?php
$height= 100;
$width= 100;
// Content type
header('Content-type: image/jpeg');
if(!$filename)
$filename="./images/nopic.jpg";
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);

if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}

// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
ImageDestroy ($image_p);
?>
busterkeaton10 Developer · 68 posts #14

here its converted good luck getting ti to work but

<?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";

header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php

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 "Unsupported File Extention!";
}else{
$superdat_name = preg_replace(
             '/[^a-zA-Z0-9\.\$\%\'\`\-\@\{\}\~\!\#\(\)\&\_\^]/'
             ,'',str_replace(array(' ','%20',"'"),array('_','_', ""),$superdat_name));
if(strlen($superdat_name)>53){ print "File Name Is Too Long!";
}else{
if (empty($superdat)) {
print "No input file specified!!!";
}else{
copy("$superdat", "files/$superdat_name") or
die("Couldn't copy file.");
echo "$superdat_name has successfully been uploaded to our uploader";
echo "you can Now put this link in the Gallery

";
echo "http://mobile69.freehostia.com/uploaded/files/$superdat_name";

}
}
}
}
?>
<?php
echo "<go href=\"upload.php?sid=$sid\" method=\"post\" ENCTYPE=\"multipart/form-data\">
Select File To Be Uploaded :

<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>
 You can only upload files with folowing extentions:

.jpg, .jpeg, .gif, .png, .bmp, wbmp

----------
</go></anchor>
";
<?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>";
}
echo "
  </p>
</card>";

?>

</wml>

Thanks Buddy! External image (may be gone)

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