Hi ,
I am trying to use CURL to query the results for example.
When i query the result I want to display as if it coming from my website
When the user clicks "next" it shouldnt show the external url
but give the feeling as if its coming from inside my website
example http://mypage.com/curl.php?query1=val1&q2=val3
this is what i have so far. I hope was able to explain it well.
Any help example/sample woudl be appreciated.
thanks in advance
<?php
// FIND BOOKS ON PHP AND MYSQL ON AMAZON
$url = "http://www.amazon.com/exec/obidos/search-handle-form/002-5640957-2809605";
$ch = curl_init(); // initialize curl handle
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s
curl_setopt($ch, CURLOPT_GET, 1); // set POST method
curl_setopt($ch, CURLOPT_GETFIELDS, "url=index%3Dbooks&field-keywords=PHP+MYSQL"); // add POST fields
$result = curl_exec($ch); // run the whole process
curl_close($ch);
print_r($result);
?>