par
Selinaa » 17 avr. 2012, 20:23
Alors j'ai regardé, et je n'ai aucune erreur qui s'affiche.
En fait, j'ai que ça :
C'est vraiment bizarre...
<?php
$xml = '<?xml version="1.0" encoding="UTF-8"?>';
$xml .= '<rss version="2.0">';
$xml .= '<channel>';
$xml .= '<title></title>';
$xml .= '<link>http://www.monsite.com</link>';
$xml .= '<description>Toute notre actualité en un clic !</description>';
$xml .= '<copyright>b 2012</copyright>';
$xml .= '<language>fr</language>';
/* $xml .= '<image>';
$xml .= ' <title></title>';
$xml .= ' <url>http://monsite.com/images/logo_flux.png</url>';
$xml .= ' <link>http://www.monsite.com</link>';
$xml .= '</image>';*/
$today= date("D, d M Y H:i:s +0100");
//date du jour d'execution du fichier PHP
$xml .= '<pubDate>'.$today.'</pubDate>';
require ("includes/config.php");
// Faîtes appel à vos fichier de connection à votre base de donnée MySQL
mysql_connect($host, $user, $pass) or die("Impossible de se connecter : ". mysql_error());
mysql_select_db($db) or die("Select `$db` impossible : ". mysql_error());
mysql_query("SET NAMES UTF8");
// Adaptez ces lignes à votre base de données / noms de table
$resultat_requete=mysql_query("SELECT * FROM article ORDER BY DateArticle DESC limit 0, 10") or die(mysql_error());;
// extraction des 10 dernières nouvelles
while($lig=mysql_fetch_assoc($resultat_requete)){
$titre=$lig["TitreArticle"];
$adresse="http://www.monsite.com/article.php?id=".$lig["NoAutoArticle"];
$contenu=$lig["DescriptionArticle"];
$date=$lig["DateArticle"];
$datephp=date("D, d M Y H:i:s +0100", $date);
$xml .= '<item>';
$xml .= '<title>'.$titre.'</title>';
$xml .= '<link>'.$adresse.'</link>';
$xml .= '<guid>'.$adresse.'</guid>';
$xml .= '<pubDate>'.$datephp.'</pubDate>';
$xml .= '<description>'.$contenu.'</description>';
$xml .= '</item>';
}//fin du while
$xml .= '</channel>';
$xml .= '</rss>';
$fp = fopen("fluxrss.xml", 'w+');
fputs($fp, $xml);
fclose($fp);
echo 'Export XML effectue !<br /><a href="fluxrss.xml">Voir
le fichier</a>';
?>
Alors j'ai regardé, et je n'ai aucune erreur qui s'affiche.
En fait, j'ai que ça :
[img]http://img15.hostingpics.net/pics/969142rss.jpg[/img]
C'est vraiment bizarre...
[php]<?php
$xml = '<?xml version="1.0" encoding="UTF-8"?>';
$xml .= '<rss version="2.0">';
$xml .= '<channel>';
$xml .= '<title></title>';
$xml .= '<link>http://www.monsite.com</link>';
$xml .= '<description>Toute notre actualité en un clic !</description>';
$xml .= '<copyright>b 2012</copyright>';
$xml .= '<language>fr</language>';
/* $xml .= '<image>';
$xml .= ' <title></title>';
$xml .= ' <url>http://monsite.com/images/logo_flux.png</url>';
$xml .= ' <link>http://www.monsite.com</link>';
$xml .= '</image>';*/
$today= date("D, d M Y H:i:s +0100");
//date du jour d'execution du fichier PHP
$xml .= '<pubDate>'.$today.'</pubDate>';
require ("includes/config.php");
// Faîtes appel à vos fichier de connection à votre base de donnée MySQL
mysql_connect($host, $user, $pass) or die("Impossible de se connecter : ". mysql_error());
mysql_select_db($db) or die("Select `$db` impossible : ". mysql_error());
mysql_query("SET NAMES UTF8");
// Adaptez ces lignes à votre base de données / noms de table
$resultat_requete=mysql_query("SELECT * FROM article ORDER BY DateArticle DESC limit 0, 10") or die(mysql_error());;
// extraction des 10 dernières nouvelles
while($lig=mysql_fetch_assoc($resultat_requete)){
$titre=$lig["TitreArticle"];
$adresse="http://www.monsite.com/article.php?id=".$lig["NoAutoArticle"];
$contenu=$lig["DescriptionArticle"];
$date=$lig["DateArticle"];
$datephp=date("D, d M Y H:i:s +0100", $date);
$xml .= '<item>';
$xml .= '<title>'.$titre.'</title>';
$xml .= '<link>'.$adresse.'</link>';
$xml .= '<guid>'.$adresse.'</guid>';
$xml .= '<pubDate>'.$datephp.'</pubDate>';
$xml .= '<description>'.$contenu.'</description>';
$xml .= '</item>';
}//fin du while
$xml .= '</channel>';
$xml .= '</rss>';
$fp = fopen("fluxrss.xml", 'w+');
fputs($fp, $xml);
fclose($fp);
echo 'Export XML effectue !<br /><a href="fluxrss.xml">Voir
le fichier</a>';
?>[/php]