Can't Figure out this Include Script


#1

I’m trying to include the dynamically-generated content located here:

http://www.info-mac.org/rss2html.php?XMLFILE=http://forums.info-mac.org/rss.php&TEMPLATE=http://www.info-mac.org/sample-template.html&MAXITEMS=10

Into another HTML file of mine. The documentation that came with the script gave the following for example usage:

[quote]Example Usage

Server Side Include:

< !–#INCLUDE VIRTUAL=“rss2html.php?XMLFILE=http://forums.info-mac.org/rss.php&TEMPLATE=http://www.info-mac.org/sample-template.html&MAXITEMS=10” – >

Prefered PHP Include:

<?php $XMLFILE = "http://forums.info-mac.org/rss.php"; $TEMPLATE = "http://www.info-mac.org/sample-template.html"; $MAXITEMS = "10"; include("rss2html.php"); ?>

PHP Include (Due to security concerns many ISP have configured their servers to prevent this from working):

<?php include("http://www.info-mac.org/rss2html.php?XMLFILE=http://forums.info-mac.org/rss.php&TEMPLATE=http://www.info-mac.org/sample-template.html&MAXITEMS=10"); ?>[/quote]

I cannot get any of that to work though. I don’t know what that means I’m supposed to do? I tried the Server Side Include in both an HTML and SHTML file and it doesn’t work for me.

What am I missing here?

This is where I tried it: http://www.info-mac.org/rsstest.shtml


#2

You are running up against this problem, and you will need to adapt your script to use cURL. I could’ve sworn that rss2html had been adapted to use cURL already, so you might want to check with the developers about that.

si-blog
Max discount on any plan with promocode SCJESSEYTOTAL


#3

The RSS2HTML web site says the PHP script below is adapted to use cURL, but when I have this included instead of the server-side include, it just shows me a blank page:

<?php $XMLFILE = "http://forums.info-mac.org/rss.php"; $TEMPLATE = "http://www.info-mac.org/sample-template.html"; $MAXITEMS = "10"; include("rss2html.php"); ?>

Am I wrong in simply putting that in the body of my HTML file? Why wouldn’t that be working if it’s cURL compatible? Do I have to turn cURL on or something?


#4

OK, I changed it a little so that now simply going to the php file located at http://www.info-mac.org/feed.php generates the page I want to include.

I put this into the body of an HTML file located at http://www.info-mac.org/rsstest.shtml

< !–#include FILE=“feed.php” – >

But going to the rsstest.shtml pages generates a blank page in Firefox and a “Bad Server Response” error in Safari.

What am I doing wrong?


#5

Unless you have modified your .htaccess to allow parsing of .html files as PHP, then your stuff between the php tags is just being treated as an unrecognized tag (ignored).

You need to put that code inside a .php file. :wink:

–rlparker