473,803 Members | 4,139 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("Locatio n: http://127.0.0.1/custlogin.php") ;
exit; }

require_once('C onnections/local.php');

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

// connection to log download, works ok
mysql_select_db ($database_loca l, $local);
$sql = "INSERT INTO downloads (swid, date, time) VALUES
('$swid',curren t_date(),curren t_time())";
$result = mysql_query($sq l) or die(mysql_error ());

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

// connection to grab url of the file which I hope to go to in header
tag //
mysql_select_db ($database_loca l, $local);
$query_dllink = sprintf("SELECT dllink FROM software WHERE swid = %s",
$colname_dllink );
$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);
?>
Jul 17 '05 #1
1 1608
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
5781
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
6
1381
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 it as below but it does not seem to do the trick. Would be happy if anyone has a solution for this problem. struct str { int i;
17
2742
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. According to event received (say - event ID), it will update client pages, that need updating based on this ID (if currently there exist clients that are interesting in specific ID). The good example of such site - airport flight information, when...
0
1163
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 in the HREF but I don't know if the java script is coming out of a server side control or if it was manually added to the page. Thanks, jeff
10
1422
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 System.EventArgs) Handles Button1.Click Dim t As Thread t = New Thread(AddressOf Me.BackgroundProcess)
3
2302
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 ! Thanks Paul
2
3434
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 code for the event, but under OnCurrent does not show up on the properties of the subform, and the event does not fire. When this problem happened, it seems to have also generated an error while changing records in the Main Form. The error is...
3
2420
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 program the URL to download the other program from. So I need to work out how I can do the same thing without having a hard coded URL in the file. It is an executable generated from a C compiler so I don't want customers to have to edit a C source...
4
3644
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 Content Extractor. I created cmd file and write the following text to file "C:\Program Files\Web Content Extractor\WCExtractor.exe" "D:\ASP.NET\teachnetwork\manager\Scrapfiles\abc-teachers.wcepr" -dr -rt -s -ddr -qe -ex"
0
10542
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10068
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9119
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7600
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6840
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5496
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3795
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2968
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.