cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Search with google with Curl?

From: Anders Dahlgren <dahlgren-anders_at_telia.com>
Date: Thu, 9 Oct 2003 23:38:41 +0200

Hi, I want use curl to search google. That can't be that tough? I have tried to like this

<?
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,"http://www.google.com/");
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, "f=mysearchstring");
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);

$result =curl_exec ($ch);
curl_close ($ch);
echo $result;

?>

But it doesnt work.
All suggestions or help, are appreciated.

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
Received on 2003-10-10