Re: submit to a remote form without the use of curl?? Is it possible?
| From: | Curt Zirzow | Date: | Tue, 28 Sep 2004 03:07:14 +0000 |
| Subject: | Re: submit to a remote form without the use of curl?? Is it possible? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198041@lists.php.net to get a copy of this message | ||
* Thus wrote bclem@imaginative-enterprises.com:
>
>
> Is it possible with php to submit to a remote form without the use of curl?
I'm assuming you want to POST a form verses a GET, since you can
easily do a GET form submission like:
$fp = fopen('http://domain.com/?get=var', 'r');
in PHP5 you can accomplish this using the new zcontext parameter:
$postdata = 'foo=bar';
$contextConf = array(
'http' => array (
'method' => 'POST',
'header' => "Content-Length: " . strlen($postdata) . "\r\n",
'content' => $postdata
),
);
$zcontext = stream_context_create($contextConf);
$fp = fopen('http://domain.com/', 'r',
$zcontext);
Curt
--
The above comments may offend you. flame at will.