Hi guys, I have a data base to store some .doc file and actually i give a link in one of pages. When i click the link, i wan to show the content of the doc file in the webpages. the code is given below
[PHP]<a href="file.php?id=<?php echo $row['id']; ?>" target="new window">File</a>[/PHP]
and the the file.php is given below
[PHP]
<?php
include "config.inc.php";
include "connect.inc.php";
if(isset($_GET['id']))
{
$id = $_GET['id'];
$query = "SELECT filename, filetype, filesize, content FROM candidate_table where id = '$id'";
$result = mysql_query($query) or die(mysql_error());
list($name, $type, $size, $content) = mysql_fetch_array($result);
echo "<div style=\"border:1px blue solid; \">";
echo $content;
echo "</div>";
/*
header("Content-length:$size");
header("Content-type:$type");
header("Content-Disposition:attachment; $filename=$name");
echo $content;*/
exit;
}
?>
[/PHP]
But the problem is that, when i click, it working but the content showing in the web pages is not like wat i submitted.
it shwing some thing like this too
[HTML]
m’¾oµ¶Áù)HIkƒ„“¬Áá!;<=ý ýýýýýýýøøøøøýýýýýýýýýýýýý & F=ý 1h°Ð/ °à=!°"°# $ %°ÇDÐÉêyùºÎŒ‚ªK© engr@habsons.netàÉêyùºÎŒ‚ªK© 0mailto:engr@habsons.net i8@ñÿ8 NormalCJ_HaJmH sH tH *B*phÿ=ÿÿÿÿ m’¾oµ¶Áù)HIkƒ„“¬Áá!;<?˜0€€˜ 0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜ 0€€˜ 0€€˜ 0€€˜ 0€€˜ 0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0 €€˜0€€===4[l=Xÿ„??ÿÿjobsupdC:\Documents and Settings\jobsup1\Application Data\Microsoft\Word\AutoRecovery save of Document1.asdjobsup6C:\Documents and Settings\jobsup1\Desktop\Dear Mr.docv)c”fÞÈÿÿÿÿÿÿÿÿÿ„8„0ýÆ 8^„8`„0ýo
[/HTML]
I want to know how to show the exact content in the web pages,
plz guide me .. thanks