From 49fb0c290f9353a1194dc835d211ae9beb9ddcf8 Mon Sep 17 00:00:00 2001 From: Sebastian Titz Date: Mon, 29 Nov 2021 10:39:44 +0100 Subject: [PATCH] post request --- .gitignore | 1 + _func.php | 1 + webcron.php | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 webcron.php diff --git a/.gitignore b/.gitignore index 4f0010b..0db3f06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /.buildpath /.project +/.settings /secret.php /config.php /test.php diff --git a/_func.php b/_func.php index f37372f..5198478 100644 --- a/_func.php +++ b/_func.php @@ -4,6 +4,7 @@ include_once ('sql.php'); $sql = new SQL (); include_once ('string.php'); include_once ('numbers.php'); +include_once ('webcron.php'); include_once ('mail.php'); include_once ('debug.php'); // include_once ('markdown.php'); diff --git a/webcron.php b/webcron.php new file mode 100644 index 0000000..94eabf4 --- /dev/null +++ b/webcron.php @@ -0,0 +1,24 @@ + json_encode ( array ( + 'domain' => $_SERVER ['HTTP_HOST'], + 'typ' => ($_servicetype ?? 'default') + ) ) + ); + $options = array ( + 'http' => array ( + 'header' => "Content-type: application/x-www-form-urlencoded\r\n", + 'method' => 'POST', + 'content' => http_build_query ( $data ) + ) + ); + $context = stream_context_create ( $options ); + $result = file_get_contents ( $url, false, $context ); + if ($r = json_decode ( $result )) { + // $r->status + } +} + +?> \ No newline at end of file