note 66343 added to function.fopen
| From: | roman dot nastenko at gmail dot com | Date: | Fri, 19 May 2006 15:09:19 +0000 |
| Subject: | note 66343 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111688@lists.php.net to get a copy of this message | ||
php 4.4.2 realy introduced a blocker problem with fopen() (http://bugs.php.net/bug.php?id=36017)
In that case you can use sockets for file open.
Example. Not
$viart_xml = fopen("http://www.viart.com/viart_shop.xml",
"r");
But
$viart_xml = fsockopen("www.viart.com", 80, $errno, $errstr, 12);
fputs($viart_xml, "GET /viart_shop.xml HTTP/1.0\r\n");
fputs($viart_xml, "Host: www.viart.com\r\n");
fputs($viart_xml, "Referer: http://www.viart.com\r\n");
fputs($viart_xml, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1)\r\n\r\n");
After that you can use $viart_xml as a simple file :)
----
Server IP: 195.248.191.91
Probable Submitter: 193.24.25.61
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.fopen.php
Edit -- http://master.php.net/note/edit/66343
Del: integrated -- http://master.php.net/note/delete/66343/integrated
Del: useless -- http://master.php.net/note/delete/66343/useless
Del: bad code -- http://master.php.net/note/delete/66343/bad+code
Del: spam -- http://master.php.net/note/delete/66343/spam
Del: non-english -- http://master.php.net/note/delete/66343/non-english
Del: in docs -- http://master.php.net/note/delete/66343/in+docs
Del: other reasons-- http://master.php.net/note/delete/66343
Reject -- http://master.php.net/note/reject/66343
Search -- http://master.php.net/manage/user-notes.php