From bf3847219714d71e59bfa04569089ab52f852960 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 4 Dec 2014 17:10:49 +0100 Subject: Finished tool for checking downtime --- down/http.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 down/http.php (limited to 'down/http.php') diff --git a/down/http.php b/down/http.php new file mode 100644 index 0000000..9973cb4 --- /dev/null +++ b/down/http.php @@ -0,0 +1,31 @@ +=200 && $httpcode<400 ) + return true; + else + return false; +} + +function sanitizeUrl($url){ + if ( ! preg_match("|^[a-zA-Z]+://|", $url) ) + $url = "http://" . $url; + if ( preg_match("|^[a-zA-Z]+://.+\.[a-zA-Z]+(?/.*)|", $url, $match) ) + $url = str_replace($match["query"], "", $url); + + return $url; +} -- cgit v1.2.3