Google uses GET anyway, not POST.
A simple fopen() is all you need, but then you'll be parsing HTML. The
API is better for reliability.
Paul Nicholson wrote:
>I don't think you'll get php to work with google unless you use the google
>api - I heard that google has filtered out the php(and others) user-agent.
>If you need more info on the google api just let me know.
>
>On Friday 27 September 2002 07:25 pm, [EMAIL PROTECTED] wrote:
>
>
>> I am trying to use curl to post data to a search engine and then
>> return the results in a variable so I can manipulate it.
>> I have tried this but it does not seam to work properly.
>> This is just an example of how I am trying to do this I don't have
>> to use google for the search engine just thought if I can get it
>> working with this I can get it to work with others
>>
>>$ch = curl_init ("http://www.google.com/");
>>curl_setopt ($ch, CURLOPT_POST, 1);
>>$word="php";
>>$args="action=/search&hl=en&ie=UTF-8&oe=UTF-8&q=$word&btnG=Google Search";
>>curl_setopt ($ch, CURLOPT_POSTFIELDS, $args);
>>curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
>>$data = curl_exec ($ch);
>>curl_close ($ch);
>>echo $data;
>>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php