imarockstar Posted November 11, 2008 Share Posted November 11, 2008 hello freaks I have a DB that stored rss feeds, the feeds are stored in the variable RSS. Here is what the feeds look like in the DB : <?php readfile('http://rssifyme.com/rss.php?uid=rss_483edb7123786&rss[]=http%3A%2F%2Fwww.topix.com%2Frss%2Fsearch%2Farticle%3Fx%3D0%26y%3D0%26q%3D%2522solar%2Benergy%2522&rss[]=http%3A%2F%2Ffeeds.technorati.com%2Fsearch%2F%2522solar%2Benergy%2522%3Fauthority%3Da4%26language%3Den&rss[]=http%3A%2F%2Fblogsearch.google.com%2Fblogsearch_feeds%3Fhl%3Den%26scoring%3Dd%26q%3D%2522solar%2Benergy%2522%26ie%3Dutf-8%26num%3D10%26output%3Drss&number[]=5&number[]=3&number[]=3&width=490&ifbgcol=FFFFFF&bordercol=FFFFFF&textbgcol=FFFFFF&window=on&fontcol=000000&font=Tahoma&fontsize=14&href=228C32&href_h=42B754&title=on'); ?> I am displaying it using this method : <h2 class='boxtitle'>Current Code</h2> <? print $rows['rss']; ?> for some reason the above is actually printing the rss php feed, like its printing it after the page is parsed. How can i have it place that code before the page is parsed so it shs the rss feed ? Quote Link to comment https://forums.phpfreaks.com/topic/132328-echoing-php-code-havin-a-little-trouble-here/ Share on other sites More sharing options...
DarkWater Posted November 11, 2008 Share Posted November 11, 2008 What? You actually have the PHP stored in the database? Quote Link to comment https://forums.phpfreaks.com/topic/132328-echoing-php-code-havin-a-little-trouble-here/#findComment-687986 Share on other sites More sharing options...
imarockstar Posted November 11, 2008 Author Share Posted November 11, 2008 lol ya .. I have the rss feeds stored ... is that not a good idea ? I dont really see any other option . Quote Link to comment https://forums.phpfreaks.com/topic/132328-echoing-php-code-havin-a-little-trouble-here/#findComment-687994 Share on other sites More sharing options...
premiso Posted November 11, 2008 Share Posted November 11, 2008 It's fine to do it that way, its even better to build it from the database but to each their own. If it is actual php you are storing in the DB you want to look into www.php.net/eval It can be a huge security flaw to use that, so use it wisely. Quote Link to comment https://forums.phpfreaks.com/topic/132328-echoing-php-code-havin-a-little-trouble-here/#findComment-687998 Share on other sites More sharing options...
imarockstar Posted November 11, 2008 Author Share Posted November 11, 2008 ok i switched up how i did it .. i took out the actual "php" code and jut left in the html href link ... this is ho wI am trying to display it: <?php readfile(' ' $rows['rss']' '); ?> this is my error : Parse error: syntax error, unexpected T_VARIABLE in /home/green/public_html/admin/editboxes.php on line 85 i m not sure whats going on .. the $rows['rss'] is the url i need the readfile to display . Quote Link to comment https://forums.phpfreaks.com/topic/132328-echoing-php-code-havin-a-little-trouble-here/#findComment-688018 Share on other sites More sharing options...
bobbinsbro Posted November 11, 2008 Share Posted November 11, 2008 if you're trying to add heading and trailing spaces to $rows['res'] you have to do it like this: <?php readfile(' '.$rows['rss'].' '); ?> Quote Link to comment https://forums.phpfreaks.com/topic/132328-echoing-php-code-havin-a-little-trouble-here/#findComment-688019 Share on other sites More sharing options...
imarockstar Posted November 11, 2008 Author Share Posted November 11, 2008 figured this part out .. but my below question still stands .. Quote Link to comment https://forums.phpfreaks.com/topic/132328-echoing-php-code-havin-a-little-trouble-here/#findComment-688027 Share on other sites More sharing options...
imarockstar Posted November 11, 2008 Author Share Posted November 11, 2008 so basiclly what I am asking is .. I have this stored in a database in the variable RSS : <?php readfile('http://rssifyme.com/rss.php?uid=rss_483edb7123786&rss[]=http%3A%2F%2Fblogsearch.google.com%2Fblogsearch_feeds%3Fhl%3Den%26c2coff%3D1%26lr%3D%26safe%3Dactive%26scoring%3Dd%26q%3Dinposttitle%3Abiofuel%26ie%3Dutf-8%26num%3D10%26output%3Drss&rss[]=http%3A%2F%2Ffeeds.technorati.com%2Fsearch%2Fbiofuel%3Fauthority%3Da4%26language%3Den&rss[]=http%3A%2F%2Fwww.topix.net%2Frss%2Fsearch%2Farticle%3Fblogs%3D2%26submit%3DSearch%2BAll%2BTopics%26q%3Dbiofuel&number[]=4&number[]=4&number[]=3&width=490&ifbgcol=FFFFFF&bordercol=FFFFFF&textbgcol=FFFFFF&window=on&fontcol=000000&font=Tahoma&fontsize=14&href=339E43&href_h=42B754&title=on'); ?> how can I echo that on a page using php .. not so the user cn see the php code but to where is actually executes that rss feed ? Quote Link to comment https://forums.phpfreaks.com/topic/132328-echoing-php-code-havin-a-little-trouble-here/#findComment-688031 Share on other sites More sharing options...
thebadbad Posted November 11, 2008 Share Posted November 11, 2008 Weird way of doing it. Instead store the URL in the database, and then use readfile() or something similar on the stored URL. <?php //$rows['rss'] = http://rssifyme.com/rss.php?uid=rss_483edb7123786&rss[]=http%3A%2F%2Fblogsearch.google.com%2Fblogsearch_feeds%3Fhl%3Den%26c2coff%3D1%26lr%3D%26safe%3Dactive%26scoring%3Dd%26q%3Dinposttitle%3Abiofuel%26ie%3Dutf-8%26num%3D10%26output%3Drss&rss[]=http%3A%2F%2Ffeeds.technorati.com%2Fsearch%2Fbiofuel%3Fauthority%3Da4%26language%3Den&rss[]=http%3A%2F%2Fwww.topix.net%2Frss%2Fsearch%2Farticle%3Fblogs%3D2%26submit%3DSearch%2BAll%2BTopics%26q%3Dbiofuel&number[]=4&number[]=4&number[]=3&width=490&ifbgcol=FFFFFF&bordercol=FFFFFF&textbgcol=FFFFFF&window=on&fontcol=000000&font=Tahoma&fontsize=14&href=339E43&href_h=42B754&title=on readfile($rows['rss']); ?> Quote Link to comment https://forums.phpfreaks.com/topic/132328-echoing-php-code-havin-a-little-trouble-here/#findComment-688059 Share on other sites More sharing options...
trq Posted November 11, 2008 Share Posted November 11, 2008 but my below question still stands .. Your question was answered several replies ago. Quote Link to comment https://forums.phpfreaks.com/topic/132328-echoing-php-code-havin-a-little-trouble-here/#findComment-688087 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.