Thread: php script...
View Single Post
Old 07-09-2011, 07:01 PM  
qwe
Confirmed User
 
Join Date: Jul 2003
Posts: 2,109
Quote:
Originally Posted by potter View Post
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 />';
		}
	}
?>
gives me Fatal error: Call to undefined function: get_headers() in /www/users/check.php on line 4
qwe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote