Files

28 lines
498 B
PHP

<?php
// dans /var/www/w.lanisys.fr sur le serveur ionos
$data = file_get_contents('/etc/wapi/data');
$ctx = stream_context_create([
'http' => [
'timeout' => 4,
'header' => [
'X-data: '.$data
]
],
]);
$rep = file_get_contents(
"https://api.lanisys.fr:50000/",
false,
$ctx
);
$pos = strpos($rep, "https://");
if ($pos !== false)
{
header("Location: ".substr($rep, $pos));
exit;
}
else
echo $rep;