Jump to content

Please help me, having trouble with this script


dinold

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.