note 14663 added to function.fopen.php
| From: | bradburn at kiwi dot de | Date: | Wed, 08 Aug 2001 14:39:51 +0000 |
| Subject: | note 14663 added to function.fopen.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16477@lists.php.net to get a copy of this message | ||
if you get the "warning - success" error with fopen() - meaning something was opened but
not what was expected - and you are sure the page exists, then it may be a COOKIE is being sent
back, which PHP can't handle (or at least, fopen() can't). A hack to get the URL (e.g.
"MYURL") is the following command, assuming you have lynx on your system:
exec("lynx -accept_all_cookies -dump 'MYURL',$result);
This will give you the page as an array of lines in $result. If you want, implode() the result to
get a single variable with all the text:
$result = implode('',$result);
Do make sure to make any variables you pass to the URL safe, by using, e.g. with $MYURL:
$URL = escapeshellarg("$MYURL");
exec("lynx -accept_all_cookies -dump $URL,$result);
Hope this helps!
http://www.php.net/manual/en/function.fopen.php