php - Submit form Store Response -
i have form lies on server not have control of. lets call form1. know post requirements of form1. creating own form submit data form1. lets call 1 form2. form1 returns ticket number, need store ticket number department database, along other information (that part ok with). need form2(my form) submit data form1(its form) , store response form1 our department database.
what easiest way this? have searched online hours, , have come empty. went javascript iframe ajax jquery. , lost now.
my server php server, theirs asp server.
thanks in advance.
this not client-side operation, server side operation. there no need "form2". want use curl this. this:
// set connection target of form1 (this "action" attribute of form1) $curl_connection = curl_init('http://hostname.com/form1.asp'); // set options -- connection timout, store string, follow redirects curl_setopt($curl_connection, curlopt_connecttimeout, 30); curl_setopt($curl_connection, curlopt_returntransfer, true); curl_setopt($curl_connection, curlopt_followlocation, 1); // set post fields, query string , contains contents of form1 fields curl_setopt($curl_connection, curlopt_postfields, "field1=value1&field2=value2"); // run query , capture results $data = curl_exec($curl_connection); curl_close($curl_connection); // @ point $data should contain ticket number var_dump($data);
Comments
Post a Comment