I am using Pligg CMS for one of my websites and I am trying to parse and display an xml file using smarty. So here is the code that i have used to do that
{$xml = simplexml_load_file('http://localhost/pligg/featured.xml')} {if !empty($xml)} {$cnt = 0} {foreach $xml->container->item as $item} <h4><a href="{$item->link}">{$item->title}</a></h4> <h2>{$item->image}</h2> {/foreach} {else} <p>No feed found...</p> {/if} but when i use this code in my homepage, the page goes completely blank and doesnot written anything. So what am i doing wrong?
No comments:
Post a Comment