Hallo,
Ik probeer met Curl variabelen van de ene naar de nadere pagina te zenden.
Ik heb daartoe het voorbeeld op http://devzone.zend.com/node/view/id/1081
(// FIND BOOKS ON PHP AND MYSQL ON AMAZON) gebruikt.
Dat werkt goed, echter, de adresbalk van de browser blijft de locatie van
het aanroepende script weergeven. Ik zou eerder verwachten dat mijn
testscript de variabelen naar http://devzone.zend.com/node/view/id/1081 post
en dat dan in de adresbalk http://devzone.zend.com/node/view/id/1081 staat.
Is iemand hier ook wel eens tegen dit probleem aangelopen en weet iemand
wellicht een oplossing?
Hieronder de code uit het voorbeeld.
Marcel
<?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_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS,
"url=index%3Dbooks&field-keywords=PHP+MYSQL"); // add POST fields
$result = curl_exec($ch); // run the whole process
curl_close($ch);
echo $result;
?>

Likes:

Quote