jackal4me Posted April 17, 2011 Share Posted April 17, 2011 hi, this is shan and i need help in php recently i was working on a php parser that would fetch information from my blog but it isn't working as i planned and i need to helt the progress of my site that i'm going to publish the first problem with the main file would be this error: Parse error: syntax error, unexpected T_ENDFOREACH in C:\wamp\www\html\hello.php on line 103 and the code is as follws in my hello.php file and they are as follow: <ul id="widget"> <?php include('include.php');?> <?php foreach($feed->get_items('0, 4') as $item) ?> <li> <?php echo $item->get_description(); ?> <h4><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></h4> <p> <?php echo $item->get_date(); ?> </p> </li> <?php endforeach ; ?> </ul> </div><!--end container--> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="jquery.newsScroll.js"></script> <script type="text/javascript"> $('#widget').newsScroll({ speed: 2000, delay: 5000 }); // or just call it like: // $('#widget').newsScroll(); </script> </div> </div> the include.php file is as follows: <?php require 'simplepie.inc'; $feed = new SimplePie('http://cooldesigner.info/blog/?feed=rss2'); $feed->handle_content_type(); ?> please help me as soon as u get this thing solved. MOD EDIT: . . . BBCode tags added. Quote Link to comment https://forums.phpfreaks.com/topic/233974-need-help-in-php-pl-help/ Share on other sites More sharing options...
Pikachu2000 Posted April 17, 2011 Share Posted April 17, 2011 Posted in wrong forum. Moved to php help. When posting code, please enclose it within the forum's . . . BBCode tags. Quote Link to comment https://forums.phpfreaks.com/topic/233974-need-help-in-php-pl-help/#findComment-1202606 Share on other sites More sharing options...
dcro2 Posted April 17, 2011 Share Posted April 17, 2011 <?php foreach($feed->get_items('0, 4') as $item): ?> Notice the colon. That's how alternative syntax works. Quote Link to comment https://forums.phpfreaks.com/topic/233974-need-help-in-php-pl-help/#findComment-1202608 Share on other sites More sharing options...
jackal4me Posted April 17, 2011 Author Share Posted April 17, 2011 thank u mistake again and sorry pikachu2000 i'm new here and this was my first post i won't make this mistaKe again Quote Link to comment https://forums.phpfreaks.com/topic/233974-need-help-in-php-pl-help/#findComment-1202614 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.