i want to open a file with ms word
below it's the code . The problem is that when word open the file it doesn't save it with the extension .doc but with .php. It's strange because if i try to opent with ms-excel the extension of the saved file is .xls .
<?php
require_once('C onnections/baza.php');
mysql_select_db ($database_baza , $baza);
$query_Recordse t1 = "SELECT bindata FROM notiz where nr=1";
$Recordset1 = mysql_query($qu ery_Recordset1, $baza) or die(mysql_error ());
$row_Recordset1 = mysql_fetch_ass oc($Recordset1) ;
$totalRows_Reco rdset1 = mysql_num_rows( $Recordset1);
if($_GET['mesaj']=="download") {
header("Content-Type: application/vnd.ms-word");
echo $row_Recordset1['bindata'];
exit();
}
?>
below it's the code . The problem is that when word open the file it doesn't save it with the extension .doc but with .php. It's strange because if i try to opent with ms-excel the extension of the saved file is .xls .
<?php
require_once('C onnections/baza.php');
mysql_select_db ($database_baza , $baza);
$query_Recordse t1 = "SELECT bindata FROM notiz where nr=1";
$Recordset1 = mysql_query($qu ery_Recordset1, $baza) or die(mysql_error ());
$row_Recordset1 = mysql_fetch_ass oc($Recordset1) ;
$totalRows_Reco rdset1 = mysql_num_rows( $Recordset1);
if($_GET['mesaj']=="download") {
header("Content-Type: application/vnd.ms-word");
echo $row_Recordset1['bindata'];
exit();
}
?>
Comment