473,385 Members | 1,474 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,385 software developers and data experts.

can't initiate download....

Hello,

php and mysql

I have the code below. It's a mixture of my hand coding and dreamweaver
created code. It's meant to log a download and then start the download.
I can do the first part ok as I can check the db and see that there is
an entry but the download won't start, it just sits there and nothing
downloads.

As well as the code below I have the following in between the <head>
tags on the html section, I am trying to redirect focus to the $dllink
which I've assigned from the select query.
-- this bit with head tags on page
<? echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"3\"
URL="http://\"$dllink\" >; ?>
-- all code below does the dirty work
<?
session_start();
if ($_SESSION[loggedin] != "yes") {
header("Location: http://127.0.0.1/custlogin.php");
exit; }

require_once('Connections/local.php');

// dreamweaver put this in
if (isset($_GET['swid'])) {
$swid = (get_magic_quotes_gpc()) ? $_GET['swid'] :
addslashes($_GET['swid']);
}

// connection to log download, works ok
mysql_select_db($database_local, $local);
$sql = "INSERT INTO downloads (swid, date, time) VALUES
('$swid',current_date(),current_time())";
$result = mysql_query($sql) or die(mysql_error());

// dreaweaver put this in
$colname_dllink = "1";
if (isset($_GET['swid'])) {
$colname_dllink = (get_magic_quotes_gpc()) ? $_GET['swid'] :
addslashes($_GET['swid']);
}

// connection to grab url of the file which I hope to go to in header
tag //
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);
?>
Jul 17 '05 #1
1 1591
hello, meant to say in my post above that the value of the dllink in my
db is something like www.somedomain.com/thefile.zip

thanks,

td.
Jul 17 '05 #2

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

Similar topics

4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
6
by: martin | last post by:
I want to initiate a union and and have the problem that I sometimes need to use float and sometimes an int. The float values (u.fval) turns up ok but not the ints (u.ival). I tried typecating...
17
by: Zvi Danovich | last post by:
Hi, I am a newby in ASP.NET, and till now wrote only simple "classic" WEB-sites. But - the time came, and now I need that: 1. Server will "listen" for some events on its local machine 2....
0
by: Jeff Jarrell | last post by:
I want to know how to initiate a postback with parameters from an anchor tag. There are many anchor tags and they are dynamic. I see some sites with the postback coming through some javascript...
10
by: Dica | last post by:
i've used threads in a couple of c# desktop apps with no problems before, but can't seem to get this code to update my listBox: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As...
3
by: PaulF | last post by:
Is it possible to use a SoapClient derived class to send a message to a Web Service (eg a .asmx file)? It it is, does anyone have any code they could point me at that actually does this ! ...
2
by: Rational Repairs | last post by:
I have run into a sudden problem and thought I'd see if anyone else has ran into this. Out of nowhere (sort-of) I am not able to access the OnCurrent event on a subform. I, of course, can write...
3
by: Angus | last post by:
I have a program which when downloaded from a server downloads another program from the same web server and then configures the downloaded program. The trouble is I have to hard code in the...
4
by: Hamayun Khan | last post by:
Hi I have Install Web content extractor on my pc. Web Content Extractor exe has the following path C:\Program Files\Web Content Extractor\WCExtractor.exe Now I used cmd file to initiate Web...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.