Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 11-03-2006, 10:25 AM What wrong here ??
Novice Talker

Posts: 5
Trades: 0
Hi there

I am using this code on my sites but the rss dont show up on my php sites, can you see anything wrong with the code ??

<?php
function parse_rss1($f) {
error_reporting(16);
$xmlfile = fopen($f, 'r');
if (!$xmlfile) return('RSS Feed down');
$readfile = fread($xmlfile ,80000);
$parsefile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
$filechunks = explode("<item>", $arrayreg[0]);
$count = count($filechunks);
echo '<font face=verdana>';
for($i=1 ; $i<=$count-1 ;$i++) {
ereg("<title>(.*)</title>",$filechunks[$i], $title);
ereg("<link>(.*)</link>",$filechunks[$i], $links);
ereg("<description>(.*)</description>",$filechunks[$i], $description);
echo str_replace('hxaxh','a',"<font style='font-size: 12px;'><hxaxh target=_blank href ='$links[1]'\>".utf8_decode($title[1])."</hxaxh></font>");
echo "<br><font color=gray style='font-size: 10px;'>".utf8_decode($description[1])."</font><BR>";
}
}
//
$xmlfeed = 'http://www.somehost.com/feed.xml';
parse_rss1($xmlfeed);
?>

__________________

Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
funnel is offline
Reply With Quote
View Public Profile Visit funnel's homepage!
 
 
Register now for full access!
Old 11-03-2006, 12:31 PM Re: What wrong here ??
Ultra Talker

Posts: 483
Trades: 0
I daresay that the fopen is failing but because you're just returning the string 'RSS Feed down' and not actually printing it, well, you're getting nothing.

Replace:
if (!$xmlfile) return('RSS Feed down');

With:
Code:
if (!$xmlfile) {
    print 'RSS Feed down';
    return;
}
Also your error_reporting call is saying to only show an error if there's something fatally wrong. That won't help your debugging. Either get rid of the line altogether or use E_ALL instead of 16 until you work out the problems.
__________________

Please login or register to view this content. Registration is FREE
TwistMyArm is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to What wrong here ??
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09888 seconds with 12 queries