Page 1 sur 1

un problème d'encodage chez free

PostPosté: 28 Oct 2010, 17:36
par qwerty
Bonjour,
Dans un de mes site chez free, l'encodage est devenu bizarre. Soit il avait des �, soit des é. Mais quand je teste en locale, tout est parfait. D'où peut venir le problème ?
merci
qwerty

PostPosté: 28 Oct 2010, 18:51
par joby
soit c'est le format ascii (ça change de Windows à Unix), soit faut que tu forces en UTF-8

PostPosté: 28 Oct 2010, 19:01
par qwerty
j'ai convertit, c'est en uft-8. Le problème, c'est qu'l a des � sur ce qui est relier a la BDD !

PostPosté: 28 Oct 2010, 22:42
par joby
c'est quoi l'adresse de ton site ?

PostPosté: 29 Oct 2010, 08:39
par qwerty
il est encore en test, et donc protéger par un .haccess.
Mais au pire, je peut te prendre des screens, et passé les sources des codes !

PostPosté: 29 Oct 2010, 08:55
par qwerty
J'ai trouver un truc intéressant :
Après la partie connexion, il faut rajouter :
Code: Tout sélectionner
mysql_query("SET NAMES UTF8");

PostPosté: 29 Oct 2010, 09:17
par qwerty
voilà, apache déconne maintenant. Sur ma page d'administration, j'ai droit à une erreur 500 !!!!!!

PostPosté: 29 Oct 2010, 10:37
par qwerty
J'ai un autre problème, mais a propos de mon flux rss.
Voilà mon code :
Code: Tout sélectionner
<?php
 include ("includes/connection.php");
mysql_connect($url_db, $login, $password);
mysql_select_db($table);
$titre = $donnees['titre'];
$contenu = $donnees['titre'];
?>
<?php
$rss.='<?xml version="1.0" encoding="utf-8"?>';
$rss.='<rss version="2.0">';
$rss.='<channel>';
$rss.='<title>****.free.fr|RSS</title>';
$rss.='<link>http://****.free.fr</link>';
$rss.='<description>Les dernières nouveautés de ****.free.fr </description>';
$retour = mysql_query('SELECT * FROM news ORDER BY id DESC LIMIT 0,5');
while ($donnees = mysql_fetch_array($retour));
$rss.='<item>';
$rss.='<title>';
$rss.= echo $titre;
$rss.='</title>';
$rss.='<description>';
 $rss.= echo $contenu ;
$rss.='</description>';
$rss.='</item>';
$rss.='</channel>';
$rss.='</rss>';
echo $rss;
?>

j'ai droit à un Parse error: syntax error, unexpected T_ECHO in /mnt/136/sda/1/a/****/rss.php on line 20
j'ai aucune idée de l'erreur !

PostPosté: 29 Oct 2010, 21:41
par qwerty
Code: Tout sélectionner
<?php
 include ("includes/connection.php");
mysql_connect($url_db, $login, $password);
mysql_select_db($table);
$titre = $donnees['titre'];
$contenu = $donnees['titre'];
$rss.='<?xml version="1.0" encoding="utf-8"?>';
$rss.='<rss version="2.0">';
$rss.='<channel>';
$rss.='<title>monsite.free.fr|RSS</title>';
$rss.='<link>http://monsite.free.fr</link>';
$rss.='<description>Les dernières nouveautés de monsite.free.fr </description>';
$rss.='<image>';
$rss.='<url>http://monsite.free.fr/minibanniere.gif</url>';
$rss.='<link>http://monsite.free.fr/</link>';
$rss.='</image>';
$retour = mysql_query('SELECT * FROM news ORDER BY id DESC LIMIT 0,5');
while ($donnees = mysql_fetch_array($retour)){
$rss.='<item>';
$rss.='<title>'.$titre.'</title>';
$rss.='<description>'.$contenu.'</description>';
$rss.='</item>';
}
$rss.='</channel>';
$rss.='</rss>';
echo $rss;
?>

J'ai ce code qui s'affiche :
Code: Tout sélectionner
<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>monsite.free.fr|RSS</title><link>http://monsite.free.fr</link><description>Les dernières nouveautés de monsite.free.fr </description><image><url>http://monsite.free.fr/minibanniere.gif</url><link>http://monsite.free.fr/</link></image><item><title></title><description></description></item></channel></rss>

PostPosté: 30 Oct 2010, 14:00
par qwerty
Code: Tout sélectionner
<?php
 include ("includes/connection.php"); //connection
mysql_connect($url_db, $login, $password);
mysql_select_db($table);
mysql_query("SET NAMES UTF8");
$titre = $donnees['titre'];
$contenu = $donnees['contenu'];
$retour = mysql_query('SELECT * FROM news ORDER BY id DESC LIMIT 0,5');
$rss.='<?xml version="1.0" encoding="utf-8"?>';
$rss.='<rss version="2.0">';
$rss.='<channel>';
$rss.='<title>RSS</title>';
$rss.='<link>http://monsite.fr.free.fr</link>';
$rss.='<description></description>';
$rss.='<image>';
$rss.='<url>http://monsite.fr.free.fr/minibanniere.gif</url>';
$rss.='<link>http://monsite.fr.free.fr/</link>';
$rss.='</image>';
while ($donnees = mysql_fetch_array($retour))
{
$rss.='<item>';
$rss.='<title>';
echo $donnees['titre'];
$rss.='</title>';
$rss.='<description>';
echo $donnees['contenu'];
$rss.='</description>';
$rss.='</item>';
}
$rss.='</channel>';
$rss.='</rss>';
echo $rss;
?>

J'ai mes news qui s'affiches mais ni les images, ni lle "design" des flux rss. Juste du texte a la queue leu leu !