redirecting errors
Posted: Mon Jul 07, 2003 10:12 pm
Hey, I've been having some trouble using headers to redirect the user to another page. My host is Lycos and I'm using IE6 (if those could be the problem). Heres an example of something that won't work, I've had numerous redirects not work although a couple do, I'm very confused about this. The following code is used to count the number of downloads:
mapdl.php
An example link to this would be: mapdl.php?file=maps/as_oilrig.bsp. But when I click the link to download it goes to the above page and just stays there and won't redirect the user. Is there anything I'm doing wrong? Any help would be appreciated.
mapdl.php
Code: Select all
<?php
include("header.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="UPDATE files SET downloads=downloads+1 WHERE file='$file'";
$result=mysql_query($query);
mysql_close();
$dlpage = $_SERVER['DOCUMENT_ROOT'] . $file . "/";
$redirect = "Location: $dlpage";
header ($redirect);
?>