Created
July 3, 2020 13:17
-
-
Save fqborges/0f166362de22e5df0927535af62160fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // php.ini | |
| // extension = php_openssl.dll | |
| $url = 'https://locationservices.mobiltracker.com.br'; | |
| $data = array( | |
| 'id' => 'YOUR_ID', | |
| 'lat' => '-30', | |
| 'lon' => '-50', | |
| 'timestamp'=> time() | |
| ); | |
| $context = stream_context_create(array( | |
| 'http' => array( | |
| 'header' => "Content-type: application/x-www-form-urlencoded\r\n", | |
| 'method' => 'POST', | |
| 'content' => http_build_query($data) | |
| ) | |
| ) | |
| ); | |
| $result = file_get_contents($url, false, $context); | |
| if ($result === FALSE) { | |
| print('Erro'); | |
| // Unable to find the wrapper “https” - did you forget to enable it when you configured PHP? | |
| // open php.ini and enable (uncomment - remove ';') line "extension = php_openssl.dll" | |
| } | |
| else { | |
| print('Sucesso'); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment