Anybody here using magpie RSS on their site
I have created a dir called magpierss as described in their install doc but I'm getting feed errors, could somebody please point me in the correct direction please
cliftonfc.co.uk is the link
Thanks
Anybody here using magpie RSS on their site
I have created a dir called magpierss as described in their install doc but I'm getting feed errors, could somebody please point me in the correct direction please
cliftonfc.co.uk is the link
Thanks
Somehow you have un-parsed PHP code appearing on the page, which suggests that it has been incorrectly embedded. Check each bit of php is preceeded by <?php and terminated with ?>.
N
Thanks for the reply Nick, here is the code which looks fine but please correct me if I'm wrong
Cheers NickCode:<?php $num_items =5; $rss = @fetch_rss('http://www.cisco.com/cdc_content_elements/rss/products/products.xml'); if ($rss) { $items = array_slice($rss->items, 0, $num_items); echo '<ul>'; foreach ($items as $item) { $href = $item['link']; $title = $item['title']; echo '<li><a href="' . htmlspecialchars($href) . '" target="_blank">'. htmlspecialchars($title) . '</a></li>'; } echo '</ul>'; } else { echo '<p>We were unable to contact or RSS feed for the latest security alerts. Sorry for any inconvenience.</p>'; } unset($rss); ?>
You need to show the source that surrounds that really because on its own that doesn't, at first glance, seem wrong.
Sorry can you explain please
Thanks
I've just worked it out. You have not got PHP enabled on your domain.
To enable it in Helm, navigate to your domain, click the 'website settings' button, select 'Version 5' from the drop down menu 'PHP' (It will currently say 'None'), and click save.
<?php $num_items =5;
$rss = @fetch_rss('http://www.cisco.com/cdc_content_elements/rss/products/products.xml');
if ($rss)
{
$items = array_slice($rss->items, 0, $num_items);
echo '<ul>';
foreach ($items as $item)
{
$href = $item['link'];
$title = $item['title'];
echo '<li><a href="' . htmlspecialchars($href) . '" target="_blank">'. htmlspecialchars($title) . '</a></li>';
}
echo '</ul>';
}
else
{
echo '<p>We were unable to contact or RSS feed for the latest security alerts. Sorry for any inconvenience.</p>';
}
unset($rss);?>
Is there PHP being used for any other parts of the page, are these static pages you have created manually, or are you using a content management system to generate it?
All I know is, if you don't parse the snippet you gave as PHP, and instead render it as HTML, it will output exactly what you are seeing.
There are no PHP error messages displayed here, it is simply rendering the PHP code as HTML.
OK what I did was create the page with dreamweaver which saved the file as an html file, I then changed the extension to php, guess this is where is has screwed up, it is has can it be sorted?
Thanks for staying with me
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks