Why does this code produce a page cannot be displayed error?

<?php 
 mysql_connect("localhost","username","password");
 mysql_select_db("database");
 $query = "SELECT file_path from photos where photos_id=$photos_id";
 $result = @mysql_query("$query");
 $row = mysql_fetch_row($result);
 $path = $row[0];
 $parts = split("/",$path);
 $file_name = $parts[count($parts)-1];

header("Content-Type: application/download\n"); 
header("Content-Disposition: attachment; filename=$file_name"); 
header("Content-Transfer-Encoding: binary"); 
$fn=fopen($path , "r"); 
fpassthru($fn);
?> 


Data Driven Design
1506 Tuscaloosa Ave
Holly Hil, FL 32117

http://www.datadrivendesign.com
http://www.rossidesigns.net


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to