Need help with include files
Posted: Sat Nov 08, 2008 10:11 am
I know C+ and I'm currently learning PHP. I have an include file that looks like this (it is called feeds.php):
And I'm including it in another file using <?php include("feeds.php"); ?> at the top of the file.
However, when I try to call a variable from the include file, nothing happens.
I write, for instance: just to see if it works, and nothing shows up. Is there something special I have to do to tell the file where $feed_Economy1 comes from?
-Yes, I have the URL correct for the include.
Thanks in advance.
Code: Select all
<?php
$rss1 = "";
$rss2 = "";
$rss3 = "";
$rss4 = "";
// Economy feeds
$feed_Economy1 = "http://feeds.washingtonpost.com/wp-dyn/rss/business/economy/index_xml";
$feed_Economy2 = "http://feeds.washingtonpost.com/wp-dyn/rss/business/government/index_xml";
$feed_Economy3 = "http://online.wsj.com/xml/rss/3_7014.xml";
$feed_Economy4 = "http://online.wsj.com/xml/rss/3_7086.xml";
?>However, when I try to call a variable from the include file, nothing happens.
I write, for instance:
Code: Select all
echo $feed_Economy1;-Yes, I have the URL correct for the include.
Thanks in advance.