<?php
include("../../cgi-php/connect.php");
connect_office()
	or exit ();
$fichier = fopen ('http://www.1info.com/base.htm', "r");
while ($str = fread ($fichier, 16)) {
        $html .=$str;
}
fclose ($fichier);

// *************** insertion record mis en commentaire evite le spam
if ($_POST['texte'] != ''){
//$res= mysql_query ("INSERT INTO livredor (date, nom, email, commentaire) VALUES (CURDATE(), '{$_POST['name']}', '{$_POST['mail']}', '{$_POST['texte']}')");
}
$res = mysql_query ("SELECT DISTINCT date, nom, email, commentaire
        FROM livredor
		ORDER BY code DESC");
if (!$res)
	print("Requete Failed");
else {
	while ($row = mysql_fetch_assoc($res)) {
	$info.="<ol style=\"list-style-type:none\"><li>";
	$info.="<div class=\"conteneur1\">\n<div class=\"centre1\">";
	$info.="<h4 class=\"doc-hga1\">\n";
	$info.="<a>{$row['email']}</a></h4>\n";
	$info.="<div class='doc-section'>\n<p class='doc-body1'>";
	$date=date("d/m/y", strtotime($row['date']));
	$texte=htmlentities($row['commentaire']);
	$info.="<b>Date:</b>$date<br /><b>Nom:</b> {$row['nom']}<br /><b>Texte:</b> $texte</p>\n</div>\n<hr />\n";
	$info.="</div>\n</div>\n";
	$info.="</li></ol>\n";
}
$html = ereg_replace ("{INFO}", "$info", $html);
echo $html;
}
mysql_free_result($res);
?>
