I have been trying to embed RSS feeds on my site with PHP so it is readable by search engines. I use http://rssfeedreader.com/ to get the codes, it gives javascript and php scripts. The javascript works fine but when I try the php script I just get a blank space on my page where the feed should be. Here is an example of the php script for a Google Sports News feed:
<?php
$olderror_reporting =error_reporting(0);
include ("http://rssfeedreader.com/rss3/rss.php?url=http%3A%2F%2Fnews.google.com%2Fnews%3Fned%3Dus%26topic%3Ds%26output%3Drss&newpage=1&chead=1&atl=&desc=1&owncss=&eleminate=&auth=1&dts=1&width=300&max=5&tlen=0&rnd=1&bt=3&bs=Double&nmb=&ntb=&naf=&nst=&nwd=0&nht=0&dlen=0&lstyle=-1&lc=Blue&bg=White&bc=Gray&spc=&ims=&tc=&ts=11&tfont=Verdana,+Arial,+Sans-serif&rf=".$HTTP_SERVER_VARS['SERVER_NAME'].$HTTP_SERVER_VARS['PHP_SELF']."&phpout=1");
error_reporting($olderror_reporting);
?>
I use php includes for my headers etc so I know the include function works on my domain, unless it is the fact that I am including an off-site file that makes a difference? I have looked for help on this but I've hit a bit of a dead end. Can anyone offer any suggestions as to what I'm doing wrong please? Any help will be greatly appreciated.
EDIT: I just tried to write my own include for a Superbikes feed, here is what I added:
<?php
include ("http://www.worldsbk.com/en/news?format=feed&type=rss");
?>
And this is what appeared on my page:
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/dazadz/public_html/rss_test.php on line 79
Warning: include(http://www.worldsbk.com/en/news?format=feed&type=rss) [function.include]: failed to open stream: no suitable wrapper could be found in /home/dazadz/public_html/rss_test.php on line 79
Warning: include() [function.include]: Failed opening 'http://www.worldsbk.com/en/news?format=feed&type=rss' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dazadz/public_html/rss_test.php on line 79
This is what makes me wonder if it is a permissions issue with the server rather than a mistake in the script, but I don't know.
<?php
$olderror_reporting =error_reporting(0);
include ("http://rssfeedreader.com/rss3/rss.php?url=http%3A%2F%2Fnews.google.com%2Fnews%3Fned%3Dus%26topic%3Ds%26output%3Drss&newpage=1&chead=1&atl=&desc=1&owncss=&eleminate=&auth=1&dts=1&width=300&max=5&tlen=0&rnd=1&bt=3&bs=Double&nmb=&ntb=&naf=&nst=&nwd=0&nht=0&dlen=0&lstyle=-1&lc=Blue&bg=White&bc=Gray&spc=&ims=&tc=&ts=11&tfont=Verdana,+Arial,+Sans-serif&rf=".$HTTP_SERVER_VARS['SERVER_NAME'].$HTTP_SERVER_VARS['PHP_SELF']."&phpout=1");
error_reporting($olderror_reporting);
?>
I use php includes for my headers etc so I know the include function works on my domain, unless it is the fact that I am including an off-site file that makes a difference? I have looked for help on this but I've hit a bit of a dead end. Can anyone offer any suggestions as to what I'm doing wrong please? Any help will be greatly appreciated.
EDIT: I just tried to write my own include for a Superbikes feed, here is what I added:
<?php
include ("http://www.worldsbk.com/en/news?format=feed&type=rss");
?>
And this is what appeared on my page:
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/dazadz/public_html/rss_test.php on line 79
Warning: include(http://www.worldsbk.com/en/news?format=feed&type=rss) [function.include]: failed to open stream: no suitable wrapper could be found in /home/dazadz/public_html/rss_test.php on line 79
Warning: include() [function.include]: Failed opening 'http://www.worldsbk.com/en/news?format=feed&type=rss' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dazadz/public_html/rss_test.php on line 79
This is what makes me wonder if it is a permissions issue with the server rather than a mistake in the script, but I don't know.
Last edited: