471,075 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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_local, $local);
$query_dllink = sprintf("SELECT dllink FROM software WHERE swid =
%s",$colname_dllink);
$dllink = mysql_query($query_dllink, $local) or die(mysql_error());
$row_dllink = mysql_fetch_assoc($dllink);
$totalRows_dllink = 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_dllink\" \">"; ?>

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 1002
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_local, $local);
$query_dllink = sprintf("SELECT dllink FROM software WHERE swid =
%s",$colname_dllink);
$dllink = mysql_query($query_dllink, $local) or die(mysql_error());
$row_dllink = mysql_fetch_assoc($dllink);
$totalRows_dllink = 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_dllink\" \">"; ?>

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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sean | last post: by
reply views Thread by Gary Herron | last post: by
5 posts views Thread by Nafai | last post: by
11 posts views Thread by Adrian | last post: by
40 posts views Thread by aslamhenry | last post: by
reply views Thread by leo001 | last post: by

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.