mirror of
https://github.com/ChronosX88/Influence-cjdns.git
synced 2024-11-09 01:11:00 +00:00
15 lines
385 B
PHP
15 lines
385 B
PHP
<?php
|
|
|
|
function send($data)
|
|
{
|
|
$data_url = http_build_query ($data);
|
|
$data_len = strlen ($data_url);
|
|
|
|
$context = stream_context_create([
|
|
'http' => ['method'=>'POST','header'=>"Connection: close\r\nContent-Length: $data_len\r\n", 'content'=>$data_url]
|
|
]);
|
|
|
|
$res = json_decode(@file_get_contents('http://'.$data['to'].'/messages/', false, $context), true);
|
|
return !empty($res);
|
|
}
|