sasquatch69 Posted January 8, 2008 Share Posted January 8, 2008 I am using the rss2html script (http://www.feedforall.com/free-php-script.htm) to pull in RSS headlines on a site. Everything in the source of the 2 generated files looks good when I access them directly: http://betatest.kera.org/includes/rss/rss2html.php?XMLFILE=http://www.publicbroadcasting.net/kera/news/rss/1.xml&TEMPLATE=http://betatest.kera.org/includes/rss/localnews.html&MAXITEMS=4 http://betatest.kera.org/includes/rss/rss2html.php?XMLFILE=http://www.npr.org/rss/rss.php?id=1001&TEMPLATE=http://betatest.kera.org/includes/rss/localnews.html&MAXITEMS=4 However, when I try to pull those files into a test page as php includes, nothing shows up: http://betatest.kera.org/includes/rss/newstest.php Here is the source code for the above file (newstest.php): <!-- Begin News Headlines --> <!-- START North Texas News Module --> <?php include("http://betatest.kera.org/includes/rss/rss2html.php?XMLFILE=http://www.publicbroadcasting.net/kera/news/rss/1.xml&TEMPLATE=http://betatest.kera.org/includes/rss/localnews.html&MAXITEMS=4"); ?> <!-- END North Texas News Module --> <!-- START NPR News Module --> <?php include("http://betatest.kera.org/includes/rss/rss2html.php?XMLFILE=http://www.npr.org/rss/rss.php?id=1001&TEMPLATE=http://betatest.kera.org/includes/rss/localnews.html&MAXITEMS=4"); ?> <!-- END NPR News Module --> <!-- End News Headlines --> It all seems deceptively simple, yet it won't work. What am I doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/85050-include-wont-display/ Share on other sites More sharing options...
rhodesa Posted January 8, 2008 Share Posted January 8, 2008 What version of PHP are you running? From the php.net site: Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote files via this function, even if allow_url_fopen is enabled. You can always use readfile() instead of include. Quote Link to comment https://forums.phpfreaks.com/topic/85050-include-wont-display/#findComment-433755 Share on other sites More sharing options...
sasquatch69 Posted January 8, 2008 Author Share Posted January 8, 2008 Readfile works, although it seems slower. I'm running PHP 5.2.2, though, and I'm using includes elsewhere on the server that are working fine. Any idea why these don't? Quote Link to comment https://forums.phpfreaks.com/topic/85050-include-wont-display/#findComment-433775 Share on other sites More sharing options...
revraz Posted January 8, 2008 Share Posted January 8, 2008 Includes that are part of your site or other sites? Check this in your php.ini allow url fopen Quote Link to comment https://forums.phpfreaks.com/topic/85050-include-wont-display/#findComment-433777 Share on other sites More sharing options...
rhodesa Posted January 8, 2008 Share Posted January 8, 2008 yeah...make sure the following is set in your php.ini: allow_url_include = On Quote Link to comment https://forums.phpfreaks.com/topic/85050-include-wont-display/#findComment-433783 Share on other sites More sharing options...
sasquatch69 Posted January 8, 2008 Author Share Posted January 8, 2008 Thanks for that tip - I will check with our host. But here's another issue: I am successfully using relative links in includes to other content on my server, but when trying to access this file as a relative link in the include with the variables already included in the file (instead of changing them via an extended URL as shown above), it still won't work. Quote Link to comment https://forums.phpfreaks.com/topic/85050-include-wont-display/#findComment-433788 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.