Invio variabili dalla pagina http://localhost/test2/index1.php alla pagina http://localhost/test2/index2.php con curl.


File: http://localhost/test2/index1.php
Codice PHP:
 $Curl_Session curl_init('http://localhost/test2/index2.php');
 
curl_setopt ($Curl_SessionCURLOPT_POST1);
 
curl_setopt ($Curl_SessionCURLOPT_POSTFIELDS"option=com_content&task=blogcategory&id=24&Itemid=55");
 
curl_setopt ($Curl_SessionCURLOPT_FOLLOWLOCATION1);
 
curl_exec ($Curl_Session);
 
curl_close ($Curl_Session); 
File: File: http://localhost/test2/index2.php

Codice PHP:
   foreach($_POST as $key=>$value)
    print 
$key " = " $value "
"

La chiamata POST viene effettuata correttamente da http://localhost/test2/index1.php alla pagina http://localhost/test2/index2.php

127.0.0.1 - - [04/Mar/2009:20:38:10 +0100] "POST /test2/index2.php HTTP/1.1" 200 399
192.168.1.2 - - [04/Mar/2009:20:38:10 +0100] "GET /test2/index1.php HTTP/1.1" 302 399

Come gli dico a curl nello script index1.php che dopo la chiamata desidero visualizzare la pagina index2.php con le variabili $_POST invece dello script index1.php?

Grazie per un suggerimento