Hi guys, i have a php file to read to content, the following is the code
[PHP]
<?php
include "config.inc.php ";
include "connect.inc.ph p";
if(isset($_GET['id']))
{
$id = $_GET['id'];
$query = "SELECT filename, filetype, filesize, content FROM candidate_table where id = '$id'";
$result = mysql_query($qu ery) or die(mysql_error ());
list($filename, $type, $size, $content) = mysql_fetch_arr ay($result);
$file = fopen($filename ,"r") or exit("unable to open");
echo "<div style=\"border: 1px blue solid; \">";
while(!feof($fi le))
{
echo fgets($file);
}
fclose($file);
echo "</div>";
/*
header("Content-length:$size");
header("Content-type:$type");
header("Content-Disposition:att achment; $filename=$name ");
echo $content;*/
exit;
}
?>
[/PHP]
but, when run the scripts, it showing the following error,
[HTML]
Warning: fopen(drgulrez[02,00][2].doc) [function.fopen]: failed to open stream: No such file or directory in C:\wamp\www\dr_ resume_databse\ cv.php on line 12
unable to open
[/HTML]
i m not able to fine the solution, if any one can help, plz help me thanks
[PHP]
<?php
include "config.inc.php ";
include "connect.inc.ph p";
if(isset($_GET['id']))
{
$id = $_GET['id'];
$query = "SELECT filename, filetype, filesize, content FROM candidate_table where id = '$id'";
$result = mysql_query($qu ery) or die(mysql_error ());
list($filename, $type, $size, $content) = mysql_fetch_arr ay($result);
$file = fopen($filename ,"r") or exit("unable to open");
echo "<div style=\"border: 1px blue solid; \">";
while(!feof($fi le))
{
echo fgets($file);
}
fclose($file);
echo "</div>";
/*
header("Content-length:$size");
header("Content-type:$type");
header("Content-Disposition:att achment; $filename=$name ");
echo $content;*/
exit;
}
?>
[/PHP]
but, when run the scripts, it showing the following error,
[HTML]
Warning: fopen(drgulrez[02,00][2].doc) [function.fopen]: failed to open stream: No such file or directory in C:\wamp\www\dr_ resume_databse\ cv.php on line 12
unable to open
[/HTML]
i m not able to fine the solution, if any one can help, plz help me thanks
Comment