Jump to content

Include won't display


sasquatch69

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.