Predmet:Re: php, query upit u word
php2word.php
PreuzmiIzvorni kôd (PHP):<?php
include ("konekcija.php");
$filename="prodajaVoca.txt";
$fh = fopen($filename, 'w')or
die("Nemoze se otv oriti!");
$res = mysql_query("SELECT * FROM prodajavoca WHERE datum='2016-07-01' LIMIT 0,20")
$output='';
{
foreach($row as $val)
{
$output .=$val. " ";
}
$output='';
}
echo "<a style='font-size:150%; color: #C90E08; href='download.php?file=".$filename."'>".$filename."</a>\n";
echo "<a href='download.php?file=".$filename."'>"."<p style='font-size:150%; color: #C90E08'>"."KLIKNI ZA DOWNLOAD"."</p></a>\n";
?>
download.php
PreuzmiIzvorni kôd (PHP):<?php
$file = $file;
if(!$file){ // file does not exist
echo '<p style="color: red;">'."nije pronasao datoteku".$file."</p>";
} else {
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$file");
header("Content-Type: application/rtf");
header("Content-Transfer-Encoding: binary");
// read the file from disk
}
?>
Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.