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
boya
post
Post #2





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

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


Dochądząc do standardu RSS wykoczyło mi takie cóś (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
  1. <?php
  2.  
  3. Warning
  4. This feed is valid, but may cause problems for some users. We recommend fixing these problems.
  5.  
  6. 1.Feeds should not be served with the &#092;"text/html\" media type
  7. 2.Your feed appears to be encoded as &#092;"ISO-8859-2\", but your server is reporting \"US-ASCII\" 
  8. 3.line 815, column 145: description should not contain onmouseover tag (3 occurrences) 
  9.  
  10. ... a></b> | Robibi | 2004-01-02 | 23:46 ]]></description>
  11. //chodzi o taga < zamykającego description
  12. 4.line 815, column 145: description should not contain onmouseout tag (3 occurrences)
  13.  
  14. ... a></b> | Robibi | 2004-01-02 | 23:46 ]]></description> //i tutaj tak samo...
  15. //chodzi o taga < zamykającego description
  16.  
  17. ?>


tak jak widać mam głównie problem z 3 i 4 punktem...

kod:
  1. <?php
  2. include(&#092;"config.php\");
  3.  
  4. echo '<'.'?xml version=\"1.0\" encoding=\"ISO-8859-2\"?'.'>';
  5. echo '<rss version=\"2.0\">';
  6. echo '<channel>';
  7. echo '<title>studinf.org</title>
  8.  <link>http://studinf.org/</link>
  9.  <description>Strona studentów drugiego roku studiów zaocznych PP | informatyka</description>
  10.  <language>pl</language>';
  11.  
  12.  
  13.  
  14. $sql_rss = &#092;"SELECT * FROM ppnews ORDER BY id DESC\";
  15. $wynik_rss = mysql_query($sql_rss);
  16.  
  17. while($rss = @mysql_fetch_array($wynik_rss))
  18. {
  19. echo &#092;"<item>
  20. <title><![CDATA[$rss[tytul]]]></title>
  21. <link>http://studinf.org</link>
  22. <description><![CDATA[$rss[text] | $rss[kto] | $rss[kiedy] ]]></description>
  23. </item>&#092;";
  24.  }
  25.  
  26. echo '</channel>
  27. </rss>';
  28. ?>
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: 5.10.2025 - 07:51