summaryrefslogtreecommitdiff
path: root/isup/http.php
diff options
context:
space:
mode:
authorroot2014-12-04 17:10:49 +0100
committerroot2014-12-04 17:10:49 +0100
commitbf3847219714d71e59bfa04569089ab52f852960 (patch)
tree1eaa8255ea1a522c16f7267cf3639bb1681279c9 /isup/http.php
parentbbe481a7fa159db107c7005f8b024bf4657c0bd6 (diff)
downloadtools.iamfabulous.de-bf3847219714d71e59bfa04569089ab52f852960.tar.gz
Finished tool for checking downtime
Diffstat (limited to 'isup/http.php')
-rw-r--r--isup/http.php31
1 files changed, 0 insertions, 31 deletions
diff --git a/isup/http.php b/isup/http.php
deleted file mode 100644
index 9973cb4..0000000
--- a/isup/http.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-function isUp($url){
- $agent = "Just checking if you are up or not.";
- $ch=curl_init();
- curl_setopt ($ch, CURLOPT_URL,$url );
- curl_setopt($ch, CURLOPT_USERAGENT, $agent);
- curl_setopt($ch, CURLOPT_NOBODY, true);
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt ($ch,CURLOPT_VERBOSE,false);
- curl_setopt($ch, CURLOPT_TIMEOUT, 5);
- curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($ch,CURLOPT_SSLVERSION,3);
- curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, FALSE);
- $page=curl_exec($ch);
- $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
-
- if($httpcode>=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]+(?<query>/.*)|", $url, $match) )
- $url = str_replace($match["query"], "", $url);
-
- return $url;
-}