Created
July 9, 2015 18:50
-
-
Save gcphost/8720d4e183154015e4bb to your computer and use it in GitHub Desktop.
Simple PHP Website Status Check and Report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$failed=true; | |
if($site=file_get_contents('http://google.com')){ | |
if(preg_match('/google/', $site)) $failed=false; | |
# Maybe your sites online but has an error.. | |
# if(preg_match('/Something went wrong/', $site)) $failed=true; | |
} | |
if($failed) mail('you @ tld.com', 'Site OFFLINE', 'WTF dude!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment