fopen won't work :(
| From: | Police Trainee | Date: | Thu, 01 May 2003 05:51:35 +0000 |
| Subject: | fopen won't work :( | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-145903@lists.php.net to get a copy of this message | ||
hello. i have been asking for help to get a remote
html file echoed onto my webpage since include()
doesn't seem to work with it anymore since the new php
version/server.
one of the list users suggested fopen(). I have used
the following code both with and without the trailing
url slash:
<?$fp=fopen("http://www.wiu.edu/stu/","r");
while (!feof ($fp)){
$buffer=fgets($fp,4096);
echo $buffer;}?>
but i get the following results with the errors on
line 2 and 3 repeating over and over and over below
what is displayed below:
Warning: fopen(http://www.wiu.edu/stu/)
[function.fopen]: failed to create stream: Invalid
argument in
/hsphere/local/home/user/domain/index.phtml on line 1
Warning: feof(): supplied argument is not a valid
stream resource in
/hsphere/local/home/user/domain/index.phtml on line 2
Warning: fgets(): supplied argument is not a valid
stream resource in
/hsphere/local/home/user/domain/index.phtml on line 3
what's wrong? it works with yahoo.com but it takes
like 15 seconds (just like include() does now for the
sites that work with it). is this possibly a server
config problem? allow url fopen is on. what should i
check or do? thanks
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com