hello
when i try to upload a image then it moves to the directory where i want. but the image does not shows up.what is the problem with this code. i get error
Warning: Cannot modify header information - headers already sent by (output started at /home/mysite/public_html/database.php:47) in /home/mysite/public_html/sharefile.php on line 13
i also defined destination folder with variable in database.php where file image should be moved. file gets move in destination folder but image is not displaying when user tries to download the image. and user gets error msg
Warning: Cannot modify header information - headers already sent by (output started at /home/mysite/public_html/database.php:47) in/home/mysite/public_html/sharefile.php on line 13
when i try to upload a image then it moves to the directory where i want. but the image does not shows up.what is the problem with this code. i get error
Warning: Cannot modify header information - headers already sent by (output started at /home/mysite/public_html/database.php:47) in /home/mysite/public_html/sharefile.php on line 13
PHP Code:
<?php
include("database.php");
include("function.php");
connectdb();
$fileid = mysql_real_escape_string ($_GET["fileid"]);
$sid = mysql_real_escape_string ($_GET["sid"]);
$file = mysql_fetch_array(mysql_query("SELECT filename, touid FROM fileshare WHERE id=$fileid"));
$uid = mysql_fetch_array(mysql_query("SELECT uid FROM session WHERE id='".$sid."'"));
$uid = $uid[0];
if ($file[1] == $uid){
header("Location: fileshare/".$file[0]);
}
else{
header("Content-type: text/html");
echo "<html><p>This file is not yours!<br/><a href="index.php?action=main&sid=$sid">Home</a></p></html>";
}
?>
i also defined destination folder with variable in database.php where file image should be moved. file gets move in destination folder but image is not displaying when user tries to download the image. and user gets error msg
Warning: Cannot modify header information - headers already sent by (output started at /home/mysite/public_html/database.php:47) in/home/mysite/public_html/sharefile.php on line 13
Comment