Jump to content

curl to post remote form


suyesh.amatya

Recommended Posts

page1.php contains html form which displays post data by print_r($_POST);

 

now page2.php has a following curl script:

 

$curl_handle=curl_init();

curl_setopt($curl_handle,CURLOPT_URL,'http://localhost/page1.php');

curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt ( $curl_handle , CURLOPT_RETURNTRANSFER , 1 );

curl_exec($curl_handle);

curl_close($curl_handle);

 

I am not being able to display this post data in the page2.php which is a curl script page.

Link to comment
https://forums.phpfreaks.com/topic/116950-curl-to-post-remote-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.