I've been getting this error on my website since I first starting making up but I didn't know how to fix it, so I just ended up using HTML redirects to other pages instead of Header("Locatio n:...").
Now I'm trying to retrieve uploaded files from my SQL database and going by the little tutorial from About.com the following file should download my uploaded file.
I get the header message because of "Header( "Content-type: $type");". I've read all the forums about this error but I can't seem to find the problem. As you can see there are no whitespaces, I'm not printing anything before I call the header.
However I am including two files which some say could cause the error but I don't know how?
[HTML]<?php session_start() ; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitl ed Document</title>
</head>
<?php
include ('connection.ph p');
$id = $_GET['id'];
$query = "SELECT data, filetype FROM uploads WHERE id = " . $id;
$result = MYSQL_QUERY($qu ery);
$data = MYSQL_RESULT($r esult,0,"data") ;
$type = MYSQL_RESULT($r esult,0,"filety pe");
Header( "Content-type: $type");
print $data;
include ('close.php');
?>
<body>
</body>
</html>[/HTML]
Any help with this would be greatly appreciated.
Thanks
Now I'm trying to retrieve uploaded files from my SQL database and going by the little tutorial from About.com the following file should download my uploaded file.
I get the header message because of "Header( "Content-type: $type");". I've read all the forums about this error but I can't seem to find the problem. As you can see there are no whitespaces, I'm not printing anything before I call the header.
However I am including two files which some say could cause the error but I don't know how?
[HTML]<?php session_start() ; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitl ed Document</title>
</head>
<?php
include ('connection.ph p');
$id = $_GET['id'];
$query = "SELECT data, filetype FROM uploads WHERE id = " . $id;
$result = MYSQL_QUERY($qu ery);
$data = MYSQL_RESULT($r esult,0,"data") ;
$type = MYSQL_RESULT($r esult,0,"filety pe");
Header( "Content-type: $type");
print $data;
include ('close.php');
?>
<body>
</body>
</html>[/HTML]
Any help with this would be greatly appreciated.
Thanks
Comment