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.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($name, $type, $size, $content) = mysql_fetch_arr ay($result);
echo "<div style=\"border: 1px blue solid; \">";
echo $content;
echo "</div>";
/*
header("Content-length:$size");
header("Content-type:$type");
header("Content-Disposition:att achment; $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@ha bsons.net i8@ñÿ8 NormalCJ_H aJmH 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\jobsup 1\Application Data\Microsoft\ Word\AutoRecove ry save of Document1.asdj obsup6C:\Docume nts and Settings\jobsup 1\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
[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.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($name, $type, $size, $content) = mysql_fetch_arr ay($result);
echo "<div style=\"border: 1px blue solid; \">";
echo $content;
echo "</div>";
/*
header("Content-length:$size");
header("Content-type:$type");
header("Content-Disposition:att achment; $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@ha bsons.net i8@ñÿ8 NormalCJ_H aJmH 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\jobsup 1\Application Data\Microsoft\ Word\AutoRecove ry save of Document1.asdj obsup6C:\Docume nts and Settings\jobsup 1\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
Comment