1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<body>
<div id="menu">
<?
include("menu.php");
mysql_connect("localhost","root","");
mysql_select_db("test2");
$reponse = mysql_query("select * from news where theme='".$_GET['theme']."'");
?> <strong><? echo $_GET['theme'];?> </strong><br/><br/><?
while($ligne=mysql_fetch_array($reponse))
{
?><em><?echo $ligne["title"];?> </em> <br/> <?echo $ligne["content"]; ?> <br/> Auteur : <?echo $ligne["auteur"];?> <br/> <?echo $ligne["ndate"];
?> <br/><br/>
<?
// create a pdf document in memory
$pdf = pdf_new();
pdf_open_file($pdf);
...............................
//La ce n'est que des lignes de code de mise en page du pdf
...............................
// finish up the page and prepare to output
pdf_end_page($pdf);
pdf_close($pdf);
$data = pdf_get_buffer($pdf);
// generate the headers to help a browser choose the correct application
header('Content-type: application/pdf');
header('Content-disposition: inline; filename=test6.pdf');
header('Content-length: ' . strlen($data));
// output PDF
echo $data;
}
mysql_close();
?>
</body>
</html> |
Partager