Rather than re-inventing the wheel with fsockopen, why don't you use an
existing HTTP client implementation written in PHP:

http://pear.php.net/package/HTTP_Client
http://framework.zend.com/manual/en/zend.http.html
http://scripts.incutio.com/httpclient/
http://www.phpclasses.org/browse/package/576.html

They should all be able to perform the HTTP POST requests that you require
and will be a lot easier to use that writing raw HTTP protocol through a
socket!

regards,
Tristan



On 6/25/07, Kijiji Xu, Ping <[EMAIL PROTECTED]> wrote:

In our product environment, there haven't curl and pecl lib,so...
If the fsockopen could solve post xml data,I would like to use it.And I
tried it, but I failed.

-----Original Message-----
From: Michael Kimsal [mailto:[EMAIL PROTECTED]
Sent: 2007年6月25日 20:16
To: solr-user@lucene.apache.org
Subject: Re: I'm using PHP curl post xml command to Solr,Is it the only
way to post data?

Using PHP5 (5.1 or higher I think)
http://us.php.net/manual/en/function.http-post-fields.php
is available.

From the example on that page:

$fields = array(
    'name' => 'mike',
    'pass' => 'passwordt'
);
$response = http_post_fields("http://www.example.com/";, $fields);


Looks pretty simple, but I haven't tried it yet.

On 6/25/07, Kijiji Xu, Ping <[EMAIL PROTECTED]> wrote:
>
> What about fsockopen, Or any other simple method?
>
>
>
> Thanks
>
>
>
> --
>
> Regards
>
> Xp from china
>
>


--
Michael Kimsal
http://webdevradio.com

Reply via email to