Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> RSS...generowanie smieci ;/
boya
post
Post #1





Grupa: Zarejestrowani
Postów: 287
Pomógł: 0
Dołączył: 26.02.2003
Skąd: Ow/Pn

Ostrzeżenie: (0%)
-----


witam napisalem cos takiego:

index.php

  1. <?php
  2. include(&#092;"config.php\");
  3.  
  4. echo '<'.'?xml version=\"1.0\" encoding=\"ISO-8859-2\"?'.'>';
  5. echo '<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\" \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">';
  6. echo '<rss version=\"0.91\">';
  7. echo '<channel>';
  8. echo '<title>studinf.org</title>
  9.      <link>http://studinf.org/</link>
  10.      <description>Domowa</description>
  11.      <language>pl</language>';
  12.  
  13.  
  14.  
  15. $sql_rss = &#092;"SELECT * FROM ppnews ORDER BY id DESC \";
  16. $wynik_rss = mysql_query($sql_rss);
  17.  
  18.     while($rss = @mysql_fetch_array($wynik_rss))
  19.     {
  20.     echo &#092;"<item>
  21.         <title>$rss[ntemat]</title>
  22.         <link>http://studinf.org</link>
  23.         <description>$rss[text]</description>
  24.         </item>&#092;";
  25.      }
  26.  
  27.  
  28. echo '</channel>
  29.         </rss>';
  30. ?>


przyklad dzialania mozecie obejrzec na http://studinf.org/rss/

nie wiem co jest zle...niby coś wypisuje ale od RSS to odbiega ;/

Ten post edytował boya 27.10.2004, 16:20:59
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
-Guest-
post
Post #2





Goście







Cytat(boya @ 2004-10-27 14:50:11)
witam napisalem cos takiego:

index.php

  1. <?php
  2. include("config.php");
  3.  
  4. echo '<'.'?xml version="1.0" encoding="ISO-8859-2"?'.'>';
  5. echo '<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">';
  6. echo '<rss version="0.91">';
  7. echo '<channel>';
  8. echo '<title>studinf.org</title>
  9.  <link>http://studinf.org/</link>
  10.  <description>Domowa</description>
  11.  <language>pl</language>';
  12.  
  13.  
  14.  
  15. $sql_rss = "SELECT * FROM ppnews ORDER BY id DESC ";
  16. $wynik_rss = mysql_query($sql_rss);
  17.  
  18. while($rss = @mysql_fetch_array($wynik_rss))
  19. {
  20. echo "<item>
  21. <title>$rss[ntemat]</title>
  22. <link>http://studinf.org</link>
  23. <description>$rss[text]</description>
  24. </item>";
  25.  }
  26.  
  27.  
  28. echo '</channel>
  29. </rss>';
  30. ?>


przyklad dzialania mozecie obejrzec na http://studinf.org/rss/

nie wiem co jest zle...niby coś wypisuje ale od RSS to odbiega ;/

(IMG:http://forum.php.pl/style_emoticons/default/laugh.gif) (IMG:http://forum.php.pl/style_emoticons/default/aaevil.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 8.10.2025 - 22:35