473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

When I run mytest.php I get the following message, but nothing shows in the database.

echo "pls wait some one have downloaded the file until he uploads you have to wait";

Expand|Select|Wrap|Line Numbers
  1. My database setup:
  2.  
  3. CREATE TABLE IF NOT EXISTS `uploadedfiles` (
  4.  
  5.   `ID` int(11) NOT NULL auto_increment,
  6.  
  7.   `filename` varchar(30) NOT NULL,
  8.  
  9.   `path` varchar(100) NOT NULL,
  10.  
  11.   `size` int(11) NOT NULL,
  12.  
  13.   PRIMARY KEY  (`ID`)
  14.  
  15. ) ENGINE=MyISAM DEFAULT CHARSET=ascii AUTO_INCREMENT=1 ;
  16.  

mytest.php:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. ?>
  3. <a href="filedownload.php?fileid=1&path=/./download/&filename=master 2000 thru 2005.xls"><b><u><font size =4>Download master 2000 thru 2005.xls file</b></u></font></a></center>
  4. <br>
  5. <a href="filedownload.php?fileid=2&path=/./download/&filename=master 2006 thru 2010.xls"><b><u><font size =4>Download master 2006 thru 2010.xls file</b></u></font></a></center>
  6.  
Dbcon.php:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $dbname = 'xxxx';
  3. $link = mysql_connect("localhost","xxxx","xxxx") or die("Couldn't make connection.");
  4. $db = mysql_select_db($dbname, $link) or die("Couldn't select database");
  5. ?>
  6.  
  7. filedownload.php:
  8.  
  9. <?php
  10. $file = $_REQUEST['filename'];
  11. $file_id = $_REQUEST['fileid'];
  12. $dir = $_REQUEST['path'];
  13.  
  14. include "Dbcon.php";
  15.  
  16. $rs = mysql_query("select * from uploadedfiles where fileid = $file_id and downloaded = 1");
  17. if (mysql_affected_rows() == 0) {
  18.       mysql_query("update uploadedfiles set downloaded=1, downloadedtime = 'somedatetiem' where fileid = $file_id");
  19.       $dir="path";
  20.       if (isset($_REQUEST["filename"])) {
  21.             $file=$dir.$_REQUEST["filename"];
  22.             header("Content-type: application/force-download");
  23.             header("Content-Transfer-Encoding: Binary");
  24.             header("Content-length: ".filesize($file));
  25.             header("Content-disposition: attachment;" filename .basename($file));
  26.             readfile("$file");
  27.  
  28.       } else {
  29.             echo "No file selected";
  30.       }
  31. } else {
  32.       echo "pls wait some one have downloaded the file until he uploads you have to wait";
  33. }      
  34. ?>
Oct 9 '10 #1
1 1178
JKing
1,206 Expert 1GB
I am sorry but I don't see a message in your post?
What message are you receiving?
Oct 12 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jonathan | last post by:
I want to save textarea contents to a mysql database with the paragraph breaks intact without having to type paragraph or break tags in HTML. How can I do that. So far, although it occurs naturally...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
2
by: Steve Amey | last post by:
Hi all At the moment I am using the following code to check to see if the oTempDataSet is not nothing and that it has tables in it: If Not oTempDataSet Is Nothing Then If...
2
by: Charlie | last post by:
Hi: For some reason, the "Running Documents" window is always empty while debugging keeping me from adding JavaScript breakpoints. Does anyone know why? Thanks, Charlie
8
by: mark_aok | last post by:
Hi all, I have a split database. Both the forms, and the tables are stored on a shared network drive (this is Access 2003). The users use the forms, and the tables on the network drive, there...
0
by: tom | last post by:
When I try to read in a csv file it gives me this error message. 'Cannot update. Database or object is read-only.' If I change the extension to txt it processes just fine. I have googled all...
11
by: =?Utf-8?B?c2NodXJzdDMw?= | last post by:
Hi, I am currently trying to get back into ASP and have begun looking at an old webpage I developed some years ago, it was fully functional back in 2002 and I had it up and running with no...
6
Carrugar
by: Carrugar | last post by:
I'm running IIS 6.0 on a Win2003 server. One web page is trying to use the new CDO method of sending e-mail but generates the following error: CDO.Message.1 error '80070005' Access is denied. ...
8
by: Sarii | last post by:
I have this massively long(to me) code and I get so excited that it's finally finish so I go to compile it to only get 18 errors then after figuring out almost all the errors, I run the program and...
7
by: valuablevalerie | last post by:
i inherited an windows oracle box. when i try to login to database, i get 12560, 1033, 19815, 3113, 16014, 19809, 16038. when i log on using , i get ora 1033. when i log on using , i get ora...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.