note 14663 deleted from function.fopen by sniper
| From: | sniper@php.net | Date: | Sat, 27 Jul 2002 20:55:23 +0000 |
| Subject: | note 14663 deleted from function.fopen by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-33713@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!