Thread: php script...
View Single Post
Old 07-09-2011, 03:10 PM  
potter
Confirmed User
 
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
This is a quick crude method but it should do it, let me know if it works (don't pay someone for <10 lines of code) ;)

Just set the list of URLS in the urls variable.

Code:
<?php
	$urls = array('http://google.com','http://yahoo.com');
	foreach ($urls as $value) {
		$siteCheck = get_headers($value);
		$statusCode = substr($siteCheck[0] , 9, 3);
		if ($statusCode >= 400) {
			print $value . ': Down<br />';
		} else {
			print $value . ': Up<br />';
		}
	}
?>
__________________


Last edited by potter; 07-09-2011 at 03:12 PM..
potter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote