dinold Posted October 19, 2008 Share Posted October 19, 2008 Hi, I am running a site that allows users to upload files and download them on their mobile. Now, I want to make users to download the file they uploaded via my server. Driectly from my site and aslo allow them to download from their mobile browser. This is the site http://www.desi-nation.info/cell/index.php. After they finished uploading their file the user must go to http://www.desi-nation.info/cell/wap.php (in their mobile browser) to download that file. (this is the code that I am using in the wap.php) <?php // send wml headers header("Content-type: text/vnd.wap.wml"); // set the correct MIME type header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // expires in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Last modified, right now header("Cache-Control: no-cache, must-revalidate"); // Prevent caching, HTTP/1.1 header("Pragma: no-cache"); // Prevent caching, HTTP/1.0 echo("<?xml version=\"1.0\"?>"); ?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <!-- begin new deck --> <wml> <!-- begin card --> <card title="wapuploader" newcontext="true"> <?php include 'config.php'; echo("<p>Download your file<br/><br/></p>"); ?> <p> Id: <input type="text" name="idnm" format="6N"/> <br/> <anchor title="Login"> Find file <go href="download.php" method="post"> <postfield name="idnm" value="$idnm"/> </go> </anchor> <br/> </p> </card> </wml> and this is the download.php script <?php // send wml headers header("Content-type: text/vnd.wap.wml"); // set the correct MIME type header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // expires in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Last modified, right now header("Cache-Control: no-cache, must-revalidate"); // Prevent caching, HTTP/1.1 header("Pragma: no-cache"); // Prevent caching, HTTP/1.0 echo("<?xml version=\"1.0\"?>"); ?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <!-- begin new deck --> <wml> <!-- begin card --> <card title="coolservice" newcontext="true"> <p> <?php include 'config.php'; $idnm = $_POST['idnm']; $sql = ("SELECT * FROM wapupld_upload WHERE idnm='$idnm'"); $result = mysql_query($sql, $db); $rs = mysql_fetch_array($result); if($rs){ $filname = $rs['filname']; $downloadurl = $hostpage . $filname; echo("File found: $filname"); echo("<br/>ID: $idnm"); echo("<anchor title='download'>"); echo("<br/>click here to download"); echo("<go href='$downloadurl' method='get'>"); echo("</go>"); echo("</anchor>"); } else { echo("No files found"); } echo("<br/><br/><anchor title='back'>"); echo("click here to go back"); echo("<go href='$wapurl' method='get'>"); echo("</go>"); echo("</anchor>"); ?> </p> </card> </wml> How do i rearrange this so the user can download from their interent browser. Please help me. Quote Link to comment https://forums.phpfreaks.com/topic/129135-please-help-me-having-trouble-with-this-script/ Share on other sites More sharing options...
dinold Posted December 31, 2008 Author Share Posted December 31, 2008 plz help me Quote Link to comment https://forums.phpfreaks.com/topic/129135-please-help-me-having-trouble-with-this-script/#findComment-727089 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.