Skip to content

Instantly share code, notes, and snippets.

@fqborges
Created July 3, 2020 13:17
Show Gist options
  • Select an option

  • Save fqborges/0f166362de22e5df0927535af62160fa to your computer and use it in GitHub Desktop.

Select an option

Save fqborges/0f166362de22e5df0927535af62160fa to your computer and use it in GitHub Desktop.
<?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