0
I am developing an application that needs to be on a local server and need to send some information to an external server, how should I do?
0
I am developing an application that needs to be on a local server and need to send some information to an external server, how should I do?
0
To 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);
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
You can give more details ?
– MagicHat
So friend, my application uses the Arduino and due to this the Arduino must be connected to the server, the application has a login system, if the user forget the password I must send an email with the new password, I tried to send the email locally with Phpmailer but it didn’t work so my idea was to send by POST the information so that the external server can send the email
– André Luis Moreira
You can create a Webservice on the external server and use it on Arduino.
– Mayron Ceccon
Hmm, thank you very much.
– André Luis Moreira