Re:fopen error
| From: | Alfonso Ballesteros | Date: | Thu, 17 Oct 2002 14:10:30 +0000 |
| Subject: | Re:fopen error | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-120331@lists.php.net to get a copy of this message | ||
First of all... thanks for trying to help...
I'll show the full piece of code I made :
$file = "http://www.ivan.ivao.org/whazzup.txt";
$fp = fsockopen($file, 80);
if (!$fp) {
echo "does not open";
} else {
echo $fp; ---------> Here is what I say it does't return anything. This
line is just to figure out what fsockopen() returns.
while (!feof($fp)) {
echo fgets ($fp,500);
}
fclose ($fp);
}
Thanks again
Alfonso
======================================
What do you mean "it returns nothing?"
fsockopen() returns a file handle. Was the file handle valid, i.e., not 0?
If true, then you must READ from the opened file handle.
Please, be more specific in your error discussion.
---- Original Message -----
From: "Alfonso Ballesteros" <alfonsoballesteros@wanadoo.es>
To: <php-general@lists.php.net>
Sent: Thursday, October 17, 2002 6:58 AM
Subject: Re: [PHP] fopen error
I'm still stuck with this...
Using fsockopen() I'm not able to open the remote file.
I use
$file = "http://www.xxx.xxx/file.txt";
$fp = fsockopen($file, 80);
and $fp returns nothing...
Any idea?
Alfonso
"Marek Kilimajer" <kilimajer@webglobe.sk> escribió en el mensaje
news:3DAE87AE.1000307@webglobe.sk...
> if allow_url_fopen is not on, you can still use fsockopen(), and no it
> doesn't affect security, if you don't open files based on unchecked user
> input.
>
> Alfonso Ballesteros wrote:
>
> >Hello
> >
> >I'm a newcomer to PHP and I wish to know how to get the contents of a
file
> >located in an URL if the parameter allow_url_fopen is "no value" in the
> >php.ini file.
> >
> >Does this parameter, if is "on", affect the security of the server?
> >
> >Thanks in advance
> >
> >Alfonso
> >
> >
> >
> >
> >
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php