plodos Posted March 5, 2008 Share Posted March 5, 2008 <? include "dbconfig.php"; header("Content-type: text/xml\n\n"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> <rss version=\"2.0\"> <channel> <title>World</title> <description>WAS</description> <copyright>Copyright 2008, xxx.com</copyright> <link>http://www.xxx.com/rss.php</link> <language>ENG</language> "; ?> <? $a=mysql_query("select * from notice_table ORDER BY user_id DESC LIMIT 10"); while ( $data = mysql_fetch_array($a) ) { $id = $data['user_id']; $title=$data['title']; $date=$data['date']; $notice=$data['notice']; ?> <item> <title><? echo $title; ?></title> <pubDate><? echo $date; ?></pubDate> <description><? echo $notice; ?></description> <link>http://www.xxx.com/?exploit=<? echo $id; ?></link> </item> <? } echo " </channel> </rss>"; ?> It doenst work..why ??? Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/ Share on other sites More sharing options...
darkfreaks Posted March 5, 2008 Share Posted March 5, 2008 try: <?php include ("dbconfig.php"); header("Content-type: text/xml\n\n"); print"<?xml version=/"1.0"/ encoding=/"ISO-8859-1"/?>"; print"<rss version=2.0> <channel> <title>World</title> <description>WAS</description> <copyright>Copyright 2008, xxx.com</copyright> <link>http://www.xxx.com/rss.php</link> <language>ENG</language> "; ?> <?php $a=mysql_query("select * from notice_table ORDER BY user_id DESC LIMIT 10"); while ( $data = mysql_fetch_array($a) ) { $id = $data['user_id']; $title=$data['title']; $date=$data['date']; $notice=$data['notice']; echo " <item> <title> $title</title> <pubDate> $date</pubDate> <description> $notice</description> <link>http://www.xxx.com/?exploit=$id</link> </item>"; } echo " </channel> </rss>"; ?> Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483467 Share on other sites More sharing options...
darkfreaks Posted March 5, 2008 Share Posted March 5, 2008 cleaned it up it should work have a nice day <?php include ("dbconfig.php"); header("Content-type: text/xml\n\n"); echo" <?xml version=1.0 encoding=ISO-8859-1?> <rss version=2.0> <channel> <title>World</title> <description>WAS</description> <copyright>Copyright 2008, xxx.com</copyright> <link>http://www.xxx.com/rss.php</link> <language>ENG</language>"; <?php $a=mysql_query("select * from notice_table ORDER BY user_id DESC LIMIT 10"); while ( $data = mysql_fetch_array($a) ) { $id = $data['user_id']; $title=$data['title']; $date=$data['date']; $notice=$data['notice']; echo " <item> <title> $title</title> <pubDate> $date</pubDate> <description> $notice</description> <link>http://www.xxx.com/?exploit=$id</link> </item>"; } echo " </channel> </rss>"; ?> Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483481 Share on other sites More sharing options...
plodos Posted March 5, 2008 Author Share Posted March 5, 2008 Parse error: syntax error, unexpected T_STRING in /home/.wings/xxxxxxx/rss.php on line 6 line 6 : <?xml version="1.0" encoding="ISO-8859-1"?> Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483484 Share on other sites More sharing options...
darkfreaks Posted March 5, 2008 Share Posted March 5, 2008 <?php include ("dbconfig.php"); header("Content-type: text/xml\n\n"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> <rss version=\"2.0\"> <channel> <title>World</title> <description>WAS</description> <copyright>Copyright 2008, xxx.com</copyright> <link>http://www.xxx.com/rss.php</link> <language>ENG</language> "; <?php $a=mysql_query("select * from notice_table ORDER BY user_id DESC LIMIT 10"); while ( $data = mysql_fetch_array($a) ) { $id = $data['user_id']; $title=$data['title']; $date=$data['date']; $notice=$data['notice']; echo " <item> <title> $title</title> <pubDate> $date</pubDate> <description> $notice</description> <link>http://www.xxx.com/?exploit=$id</link> </item>"; } echo " </channel> </rss>"; ?> Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483489 Share on other sites More sharing options...
uniflare Posted March 5, 2008 Share Posted March 5, 2008 cleaned it up it should work have a nice day <?php include ("dbconfig.php"); header("Content-type: text/xml\n\n"); echo" <?xml version=1.0 encoding=ISO-8859-1?> <rss version=2.0> <channel> <title>World</title> <description>WAS</description> <copyright>Copyright 2008, xxx.com</copyright> <link>http://www.xxx.com/rss.php</link> <language>ENG</language>"; <?php $a=mysql_query("select * from notice_table ORDER BY user_id DESC LIMIT 10"); while ( $data = mysql_fetch_array($a) ) { $id = $data['user_id']; $title=$data['title']; $date=$data['date']; $notice=$data['notice']; echo " <item> <title> $title</title> <pubDate> $date</pubDate> <description> $notice</description> <link>http://www.xxx.com/?exploit=$id</link> </item>"; } echo " </channel> </rss>"; ?> should this not be: <?php include ("dbconfig.php"); header("Content-type: text/xml\n\n"); ?> <?xml version="1.0" encoding=ISO-8859-1?> <rss version=2.0> <channel> <title>World</title> <description>WAS</description> <copyright>Copyright 2008, xxx.com</copyright> <link>http://www.xxx.com/rss.php</link> <language>ENG</language> <?php $a=mysql_query("select * from notice_table ORDER BY user_id DESC LIMIT 10") or die(mysql_error()); while ( $data = mysql_fetch_array($a) ) { $id = $data['user_id']; $title=$data['title']; $date=$data['date']; $notice=$data['notice']; ?> <item> <title> $title</title> <pubDate> $date</pubDate> <description> $notice</description> <link>http://www.xxx.com/?exploit=$id</link> </item> <?php } ?> </channel> </rss> hope this helps, Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483491 Share on other sites More sharing options...
darkfreaks Posted March 5, 2008 Share Posted March 5, 2008 uniflare the variables wont parse outside of the tags this is the correct code from above <?php include ("dbconfig.php"); header("Content-type: text/xml\n\n");?> <?xml version=/"1.0"/ encoding=/"ISO-8859-1"/?> <rss version=2.0> <channel> <title>World</title> <description>WAS</description> <copyright>Copyright 2008, xxx.com</copyright> <link>http://www.xxx.com/rss.php</link> <language>ENG</language> <?php $a=mysql_query("select * from notice_table ORDER BY user_id DESC LIMIT 10"); while ( $data = mysql_fetch_array($a) ) { $id = $data['user_id']; $title=$data['title']; $date=$data['date']; $notice=$data['notice']; echo " <item> <title> $title</title> <pubDate> $date</pubDate> <description> $notice</description> <link>http://www.xxx.com/?exploit=$id</link> </item>"; } echo " </channel> </rss>"; ?> Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483493 Share on other sites More sharing options...
uniflare Posted March 5, 2008 Share Posted March 5, 2008 oops dint notice those, here: <?php include ("dbconfig.php"); header("Content-type: text/xml\n\n"); ?> <?xml version="1.0" encoding="ISO-8859-1" ?> <rss version=2.0> <channel> <title>World</title> <description>WAS</description> <copyright>Copyright 2008, xxx.com</copyright> <link>http://www.xxx.com/rss.php</link> <language>ENG</language> <?php $a=mysql_query("select * from notice_table ORDER BY user_id DESC LIMIT 10") or die(mysql_error()); while ( $data = mysql_fetch_array($a) ) { $id = $data['user_id']; $title=$data['title']; $date=$data['date']; $notice=$data['notice']; ?> <item> <title> <?php echo($title); ?></title> <pubDate> <?php echo($date); ?></pubDate> <description> <?php echo($notice); ?></description> <link>http://www.xxx.com/?exploit=<?php echo($id); ?></link> </item> <?php } ?> </channel> </rss> hope this helps, Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483494 Share on other sites More sharing options...
plodos Posted March 5, 2008 Author Share Posted March 5, 2008 <?xml version="1.0" encoding="ISO-8859-1" ?> im using zend 5.5.1 for run the script... and Zend is making red underline for these words version and encoding also it gives an error Parse error: syntax error, unexpected T_STRING in /home/.wings/world/rss.php on line 7 Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483499 Share on other sites More sharing options...
darkfreaks Posted March 5, 2008 Share Posted March 5, 2008 try using =\"whatever\" <?php include ("dbconfig.php"); header("Content-type: text/xml\n\n"); echo" <?xml version=/"1.0/" encoding=/"ISO-8859-1/"?> <rss version=2.0> <channel> <title>World</title> <description>WAS</description> <copyright>Copyright 2008, xxx.com</copyright> <link>http://www.xxx.com/rss.php</link> <language>ENG</language>";?> <?php $a=mysql_query("select * from notice_table ORDER BY user_id DESC LIMIT 10"); while ( $data = mysql_fetch_array($a) ) { $id = $data['user_id']; $title=$data['title']; $date=$data['date']; $notice=$data['notice']; echo " <item> <title> $title</title> <pubDate> $date</pubDate> <description> $notice</description> <link>http://www.xxx.com/?exploit=$id</link> </item>"; } echo " </channel> </rss>"; ?> Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483500 Share on other sites More sharing options...
plodos Posted March 5, 2008 Author Share Posted March 5, 2008 when I use <?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?> like that Zend is underlying another sentences and version word...anyway.. Have you working script like that, could you give me! Maybe I can modify the another script.. Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483503 Share on other sites More sharing options...
darkfreaks Posted March 5, 2008 Share Posted March 5, 2008 might want to check into the parsor functions for XML http://us2.php.net/xml Link to comment https://forums.phpfreaks.com/topic/94395-noob-rss-problem/#findComment-483510 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.