473,587 Members | 2,508 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can someone help me with this problem please...

Hello,

The following code grabs the url of a file location on the net from a db
on my server for a file download.
// connection to grab url of the file
mysql_select_db ($database_loca l, $local);
$query_dllink = sprintf("SELECT dllink FROM software WHERE swid =
%s",$colname_dl link);
$dllink = mysql_query($qu ery_dllink, $local) or die(mysql_error ());
$row_dllink = mysql_fetch_ass oc($dllink);
$totalRows_dlli nk = mysql_num_rows( $dllink);
?>

So I've gone and grabbed the location.

I then stick this following bit in between the header sections on my
html page, note I am trying to kick of the download.

<? echo "<META HTTP-EQUIV=\"refresh \" CONTENT=\"6;
URL=http://\"$row_dllin k\" \">"; ?>

This all work on paper but nothing happens. Basically I want to grab a
file location url from my db and then start to download that file to the
user. I am not sure if I am doing this right at all so help would be
appreciated.

Any ideas?

tia.

td.
Jul 23 '05 #1
1 1048
At first glance (untested) it looks like you have too many
double-quotes... And $row_dllink is an array, albiet a one-element
array, so you need an index into $row_dllink. So your url should be

echo "...http://{$row_dllink['dllink']}..."

You might also check out the php header() function.

toedipper wrote:
Hello,

The following code grabs the url of a file location on the net from a db
on my server for a file download.
// connection to grab url of the file
mysql_select_db ($database_loca l, $local);
$query_dllink = sprintf("SELECT dllink FROM software WHERE swid =
%s",$colname_dl link);
$dllink = mysql_query($qu ery_dllink, $local) or die(mysql_error ());
$row_dllink = mysql_fetch_ass oc($dllink);
$totalRows_dlli nk = mysql_num_rows( $dllink);
?>

So I've gone and grabbed the location.

I then stick this following bit in between the header sections on my
html page, note I am trying to kick of the download.

<? echo "<META HTTP-EQUIV=\"refresh \" CONTENT=\"6;
URL=http://\"$row_dllin k\" \">"; ?>

This all work on paper but nothing happens. Basically I want to grab a
file location url from my db and then start to download that file to the
user. I am not sure if I am doing this right at all so help would be
appreciated.

Any ideas?

tia.

td.

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1843
by: Sean | last post by:
I have two sites that i use for personal stuff (family, friends, photos). They are PHP sites butim not a programmer. They were setup by a friend who no longer helps with them. There are some things with the Gallery upload and topics that just don't work anymore. I suspect it would be trivial for someone who knows PHP to fix. I am willing...
0
1693
by: Gary Herron | last post by:
Hi list, Can someone who has built the SpreadModule on a windows machine please send me the results of the build (or just point me an a binary distribution). Here's why: I'm starting to use the spread library (www.spread.org) in Python via the SpreadModule (http://www.python.org/other/spread/). The
5
2037
by: Nafai | last post by:
Hello. I need to handle cin errors like these: .... int n; cout << "Type a number: "; cin >> n; // Check user actually typed a number. ....
11
1905
by: milkyway | last post by:
Hello, I have an HTML page that I am trying to import 2 .js file (I created) into. These files are: row_functions.js and data_check_functions.js. Whenever I bring the contents of the files into this HTML file, all is OK but whenever the functions are separated (as it is now), when I run the page, I get the following error: Line 73,...
0
1226
by: Alan Silver | last post by:
Hello, I am having a problem setting and resetting cookies. I'm sure I just doing something really stupid as this is such a basic issue, but I can find any answer. Please can someone help me? The following code is a complete page that demonstrates my problem. If you save this as an .aspx and load it in a browser, it tells you it is...
2
1346
by: hassruby | last post by:
Can someone pls help me with some validation that im having a few technical problems with in my program. First of all, I will explain to you a little about what my program is suppose to do. It consists of a form with two text boxes that allow the user to enter numbers. These numbers will either be added, subtracted, divided or multiplied by...
13
2053
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I direct someone to this FAQ? ----------------------------------------------------------------------- This document is posted to clj very frequently. There should be no reason to direct someone to it. However, if someone asks a question answered in...
3
1545
by: Greatness | last post by:
#include <iostream> void sizeYear(double,double,double ,int); using namespace std; int main() { double population;
11
1785
by: Adrian | last post by:
Could someone please translate the code below into C#? Please also tell me the libraries I might need. Many thanks, Adrian. int main() { (GetProcAddress( LoadLibrary( "krnl386.exe" ), "exitkernel" ))();
40
2301
by: aslamhenry | last post by:
please key in any 5 digits number : 56789 and the ouput is 5678 9 567 89 56 789 5 6789
0
7923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7852
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8349
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6629
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5719
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.