Hello!
I am currently trying to POST data from one server to another, but the information must be transferred in the same way that is was created (Formatting is very important).
I am sending this message:
begin-transmission
uib3qu9bvu3b8v48v8b408v
uo45bv4b5bh09n568vb904nv
ui45b89u4bt48v08942v0842nv
uiv84b8409vn849v8i4
uv84n0b49bn8409
vb3wur5vbwvb308vbq0v
end-transmission
Code
$domain = "google.com";
$pkey = 'begin-transmission
uib3qu9bvu3b8v48v8b408v
uo45bv4b5bh09n568vb904nv
ui45b89u4bt48v08942v0842nv
uiv84b8409vn849v8i4
uv84n0b49bn8409
vb3wur5vbwvb308vbq0v
end-transmission';
$url1 = 'cp3.php'; //This is the URL I am using to check how the message is sent
$data = array(
'domain_name' => $domain,
'key' => $pkey
);
foreach ($data as $key => $value) {
$fields_string .= $key . '=' . $value . '&';
}
rtrim($fields_string, '&');
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, $url1);
curl_setopt ($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($curl, CURLOPT_POSTFIELDS, $fields_string);
$resp = curl_exec($curl);
curl_close($curl);
I kept getting invalid response error, so I changed the result URL to view what was being sent. This is what is being sent:
begin-transmissionuib3qu9bvu3b8v48v8b408vuo45bv4b5bh09n568vb904nvui45b89u4bt48v08942v0842nvuiv84b8409vn849v8i4uv84n0b49bn8409vb3wur5vbwvb308vbq0vend-transmission
Goal: To get the message transfered to the other server without loosing any line breaks so this other server can process it.
Note: I do not have access to this other server, and do not know how it processes the message. I am willing to do a bunch of trial-and-error tests though if there are multiple ways this could be done.
Thanks in advance for your help!