Communauté Informatique NDFR.net : comment créer un site comme ND - Page 3 - Programmation Web (HTML, PHP, ASP, Java, XML, etc.)
Reply
comment créer un site comme ND
Thread Tools Display Modes
  #31  
Old 09-07-2003, 23:29
Samva's Avatar
Samva Samva is offline
Niaisüre within
 
Join Date: 24-04-2003
Location: Tours
Age: 39
Posts: 2,320
Send a message via ICQ to Samva Send a message via MSN to Samva
Je m'excuse mais j'ai rien moi quand je clique sur le liens...
__________________
For the End-of-the-World spell, press "Ctrl, Alt, Delete."


Reply With Quote
  #32  
Old 09-07-2003, 23:33
Benjy's Avatar
Benjy Benjy is offline
Administrateur
 
Join Date: 21-08-2001
Location: Rueil Malmaison (92)
Age: 43
Posts: 2,043
Send a message via MSN to Benjy
Il manque quelque chose en tout début du code PHP les petits amis :
Code:
header("Content-type: text/xml");
:cool:
__________________
Merci de lire et de respecter les règles et d'utiliser la .
Reply With Quote
  #33  
Old 09-07-2003, 23:34
Samva's Avatar
Samva Samva is offline
Niaisüre within
 
Join Date: 24-04-2003
Location: Tours
Age: 39
Posts: 2,320
Send a message via ICQ to Samva Send a message via MSN to Samva
Bon en fait, la page (ouverte avec moz) donne ca..

Code:
<?xml version="1.0"?> 
<rss version="0.92">  
<channel> 
<title>CDivxstater</title> 
<description> 
création d'un cd outils pour réparer son PC 
</description> 
<link>http://cdivxstarter.free.fr</link> 
<language>fr-fr</language> 
<copyright>© moi 2003</copyright> 
<managingEditor>kenshin51@voila.fr</managingEditor> 
<webMaster>kenshin51@voila.fr</webMaster> 

<item>
<title>test</title>
<link>http://cdivxstarter.free.fr/freenews....php?id_news=2</link>
<comments>
http://cdivxstarter.free.fr/comment.php?id=
</comments>
<pubDate>06/07/2003</pubDate>
</item><item>
<title>Bonjour cdivxstater</title>
<link>http://cdivxstarter.free.fr/freenews....php?id_news=1</link>
<comments>
http://cdivxstarter.free.fr/comment.php?id=

</comments>
<pubDate>06/07/2003</pubDate>
</item> 
</channel> 
</rss>
On voit bien qu'il y a des problème avec tes balises item qui ne sont pas a la ligne... mais c'est tout.
__________________
For the End-of-the-World spell, press "Ctrl, Alt, Delete."


Reply With Quote
  #34  
Old 09-07-2003, 23:36
Samva's Avatar
Samva Samva is offline
Niaisüre within
 
Join Date: 24-04-2003
Location: Tours
Age: 39
Posts: 2,320
Send a message via ICQ to Samva Send a message via MSN to Samva
Grillaid, marfi Benjy
__________________
For the End-of-the-World spell, press "Ctrl, Alt, Delete."


Reply With Quote
  #35  
Old 10-07-2003, 12:18
kenshin kenshin is offline
Membre senior
 
Join Date: 14-01-2003
Posts: 125
j'ai ajouté cette ligne : header("Content-type: text/xml");

en dessous de <?php

est ce bon ?

voila ce qu'il me dit quand j'essaie d'afficher la page http://cdivxstarter.free.fr/freenews/menu4.php
Code:
   création d'un cd outils pour réparer son PC  http://cdivxstarter.free.fr fr-fr © moi 2003 kenshin51@voila.fr kenshin51@voila.fr
Warning: Cannot add header information - headers already sent by (output started at /var/www/free.fr/13/c/d/i/v/cdivxstarter/freenews/menu4.php:2) in menu4.php on line 16
http://cdivxstarter.free.fr/freenews....php?id_news=2 http://cdivxstarter.free.fr/comment.php?id= 06/07/2003 http://cdivxstarter.free.fr/freenews....php?id_news=1 http://cdivxstarter.free.fr/comment.php?id= 06/07/2003
Reply With Quote
  #36  
Old 10-07-2003, 16:10
Matt Matt is offline
Super modérateur
1 Highscore
 
Join Date: 24-12-2002
Posts: 4,453
c'est parce que le header doit être envoyé avant l'envoi de code HTML.
Met ça tout au début du fichier :
PHP Code:
<?php header("Content-type: text/xml"); ?>
Reply With Quote
  #37  
Old 10-07-2003, 17:08
kenshin kenshin is offline
Membre senior
 
Join Date: 14-01-2003
Posts: 125
ok Matt c'est ajouté.
il y a du mieux :

j'ai ceci maintenant
Code:
The XML page cannot be displayed 
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. 


--------------------------------------------------------------------------------

Erreur non reconnue
voici le code de la page :
Quote:
<?php header("Content-type: text/xml"); ?>
<?
echo '<?xml version="1.0"?'.'>';
?>
<rss version="0.92">
<channel>
<title>CDivxstarter</title>
<description>
création d'un cd outils pour réparer son PC
</description>
<link>
http://cdivxstarter.free.fr</link>
<language>fr-fr</language>
<copyright>© moi 2003</copyright>
<managingEditor>kenshin51@voila.fr</managingEditor>
<webMaster>kenshin51@voila.fr</webMaster>

<?php
$chemin = "./";//->chemin par rapport à la racine du script freenews
$nbnews = 5; //->nombre de news à afficher

include ($chemin . "config.php");
include ($chemin . "options.inc.php");
include ($chemin . "freenews_functions.inc.php");

//->Connection MySQL
connexion();

$sql = "SELECT id_news, titre, auteur, date_ajout FROM news WHERE validation='1' ORDER BY id_news DESC LIMIT 0, " . $nbnews;
$res = mysql_query($sql);
$nbn = mysql_num_rows($res);
while($aff = mysql_fetch_array($res)) {
if(strlen($aff['titre'] >= 30))
$aff['titre'] = substr($aff['titre'], 0, 25) . "...";

echo "<item>\n<title>" . $aff['titre'] . "</title>\n<link>" . $url_suite . "?id_news=" . $aff['id_news'] .
"</link>\n<comments>\nhttp://cdivxstarter.free.fr/comment.php?id=\n</comments>\n<pubDate>" .
$aff['date_ajout'] . "</pubDate>\n</item>";

}
mysql_close();//->je suis méticuleux, je ferme la connection
?></channel>
</rss>
où est l'erreur ?
Reply With Quote
  #38  
Old 10-07-2003, 19:59
Samva's Avatar
Samva Samva is offline
Niaisüre within
 
Join Date: 24-04-2003
Location: Tours
Age: 39
Posts: 2,320
Send a message via ICQ to Samva Send a message via MSN to Samva
Euh, ta version actuelle de menu4.php rulaize...
J'ai ca...
Code:
  <?xml version="1.0" encoding="ISO-8859-1" ?> 
- <rss version="0.92">
- <channel>
  <title>CDivxstarter</title> 
  <description>création d'un cd outils pour réparer son PC</description> 
  <link>http://cdivxstarter.free.fr</link> 
  <language>fr-fr</language> 
  <copyright>© moi 2003</copyright> 
  <managingEditor>kenshin51@voila.fr</managingEditor> 
  <webMaster>kenshin51@voila.fr</webMaster> 
- <item>
  <title>test</title> 
  <link>http://cdivxstarter.free.fr/freenews....php?id_news=2</link> 
  <comments>http://cdivxstarter.free.fr/comment.php?id=</comments> 
  <pubDate>06/07/2003</pubDate> 
  </item>
- <item>
  <title>Bonjour cdivxstater</title> 
  <link>http://cdivxstarter.free.fr/freenews....php?id_news=1</link> 
  <comments>http://cdivxstarter.free.fr/comment.php?id=</comments> 
  <pubDate>06/07/2003</pubDate> 
  </item>
  </channel>
  </rss>
__________________
For the End-of-the-World spell, press "Ctrl, Alt, Delete."


Reply With Quote
  #39  
Old 10-07-2003, 20:55
kenshin kenshin is offline
Membre senior
 
Join Date: 14-01-2003
Posts: 125
ben ça alors tout à l'heure cela ne fonctionnait pas. :eek: :eek:

Par contre l'appelet javascript ne fonctionne toujours pas.


<script language="JavaScript" src="http://cdivxstarter.free.fr/freenews/menu4.php" type="text/javascript"></script>
Reply With Quote
  #40  
Old 10-07-2003, 22:03
Matt Matt is offline
Super modérateur
1 Highscore
 
Join Date: 24-12-2002
Posts: 4,453
Ben ... Quand je regarde la page qui est censé contenir ton javascript, je me retrouve avec une page XML, donc c'est un peu logique que ça marche pas ...
Reply With Quote
  #41  
Old 10-07-2003, 22:22
kenshin kenshin is offline
Membre senior
 
Join Date: 14-01-2003
Posts: 125
ben oui c'est bien ce que je comprenais pas donc

à quoi sert le format xml et comment l'utiliser ?
Reply With Quote
  #42  
Old 10-07-2003, 23:00
Samva's Avatar
Samva Samva is offline
Niaisüre within
 
Join Date: 24-04-2003
Location: Tours
Age: 39
Posts: 2,320
Send a message via ICQ to Samva Send a message via MSN to Samva
Apres il faut un parser... pour le parcourir et récupérer rapidement les infos...

globalement le XML c'est un format universel et extensible de données... n'importe quel soft avec le bon schéma est capable de comprendre/interpréter les contenu...
__________________
For the End-of-the-World spell, press "Ctrl, Alt, Delete."


Reply With Quote
  #43  
Old 11-07-2003, 09:38
kenshin kenshin is offline
Membre senior
 
Join Date: 14-01-2003
Posts: 125
Quote:
Provient du message de Samva
Apres il faut un parser... pour le parcourir et récupérer rapidement les infos...

globalement le XML c'est un format universel et extensible de données... n'importe quel soft avec le bon schéma est capable de comprendre/interpréter les contenu...
ok merci
comment rendre utilisable le script alors .
Reply With Quote
  #44  
Old 11-07-2003, 21:26
Samva's Avatar
Samva Samva is offline
Niaisüre within
 
Join Date: 24-04-2003
Location: Tours
Age: 39
Posts: 2,320
Send a message via ICQ to Samva Send a message via MSN to Samva
Ben tu fais un fichier RSS la... donc n'importe quel soft qui sait récupérer les info par RSS est capable d'exploiter le script... (enfn me semble, faudrai que je révise mes classiques RSS...)
__________________
For the End-of-the-World spell, press "Ctrl, Alt, Delete."


Reply With Quote
  #45  
Old 11-07-2003, 21:58
kenshin kenshin is offline
Membre senior
 
Join Date: 14-01-2003
Posts: 125
ok merci samva
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cours de français Benjy Discussions sur le site et/ou le forum 47 01-05-2006 14:47
BitTorrent : les différents clients Cougar Articles 21 25-10-2004 21:15
comment configurer le réseau sous 2003 comme sous XP ? LeMoi Windows NT4/2000/XP Client 19 16-06-2003 17:15
les news dimension sur mon site, comment faire ? aragorn Discussions sur le site et/ou le forum 2 15-02-2003 13:56
creer un site en php kenny250 Discussions sur le site et/ou le forum 5 03-11-2002 11:40

All times are GMT +2. The time now is 07:44.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.