Et pour créer le bouton qui correspond : http://smartgvprod.gavoille.com/bouton/<?
// connexion base de données
$db_server = "localhost";
$db_user = "root";
$db_pass = "motdepasse";
$db_name = "mabase";
function connect($db_server, $db_user, $db_pass, $db) {
if (!($link=mysql_connect($db_server,$db_user,$db_pass))) {
exit();
}
if (!(mysql_select_db($db,$link))) {
exit();
}
return $link;
}
$connexion=connect($db_server,$db_user,$db_pass,$db_name);
$monflux = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>
<rss version=\"0.91\">
<channel>
<title>Mon fil RSS</title>
<link>http://www.monsite.com</link>
<description>Ceci est un fil RSS</description>
<language>fr-be</language>
<copyright>Copyleft</copyright>
<managingEditor>moi@monsite.com</managingEditor>
<webMaster>moi_aussi@monsite.com</webMaster>";
// 10 derniers ajouts
$sql = mysql_query("SELECT * FROM matable ORDER BY id DESC LIMIT 0, 10",$connexion);
while ($row = mysql_fetch_array($sql)) {
$id = $row["id"];
$titre = htmlspecialchars($row["titre"]);
$description = htmlspecialchars($row["description"]);
$monflux = $monflux."
<item>
<title>$titre</title>
<link>http://www.monsite.com/mapage.php?id=$id</link>
<description>$description</description>
</item>";
}
$monflux = $monflux."
</channel>
</rss>";
echo $monflux;
?>