RE: [PHP] Include Problem
| From: | Wei, Alice J. | Date: | Tue, 24 Jun 2008 17:45:14 +0000 |
| Subject: | RE: [PHP] Include Problem | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275896@lists.php.net to get a copy of this message | ||
________________________________________
From: Jim Lucas [lists@cmsws.com]
Sent: Tuesday, June 24, 2008 1:32 PM
To: Wei, Alice J.
Cc: Jay Blanchard; php-general@lists.php.net
Subject: Re: [PHP] Include Problem
Wei, Alice J. wrote:
> ________________________________________
> From: Jay Blanchard [jblanchard@pocket.com]
> Sent: Tuesday, June 24, 2008 1:10 PM
> To: Wei, Alice J.; php-general@lists.php.net
> Subject: RE: [PHP] Include Problem
>
> [snip]
> foreach ($lines2 as $line_num => $line2) {
>
> echo "<p>Line #<b>{$line_num}</b> : " . htmlspecialchars($line2) .
> "</p>";
>
> }
>
> include ('http://www.mysite.com/calculate.php');
>
>
>
> My problem is that when I use a blank file that only has
>
>
>
> <?php include
> 'http://www.mysite.com/calculate.php'; ?>
>
>
>
> The code works and displays what is meant to display. However, when I
> copy this snippet into the code even outside the foreach loop, it does
> not even read, or give me an error. Is there something I should not be
> doing here?
> [/snip]
>
> If you get no error the file is being included properly. What is the
> goal here? Is it to have calculate.php perform actions on the returned
> data from lung.txt?
>
> The goal is to do a word count of what was in lung.txt, since I don't want the users to
> interact directly with this file. However, this is not showing up at all. Any ideas?
>
> Thanks in advance.
>
Make sure you have these enabled
allow_url_fopen = On
allow_url_include = On
This might be your problem. They limit things so remote files cannot be access
via fopen/include/etc...
One of them was off when I checked, but it appears that the output does not change when I have the
foreach and the include in the file. This is not in a function or a subroutine, so this should not
have a global problem, I think. Could there be other things I missed?
Alice
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare