I'm developing an application that needs to be on a local server and I need to send some information to an external server, what should I do?
I'm developing an application that needs to be on a local server and I need to send some information to an external server, what should I do?
To make a post to an external server, use curl:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.exemplo.com.br');
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('login' => 'abc', 'senha' => '1234')));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
$consulta = curl_exec($ch);
curl_close($ch);