Cita de: el-pollo link=topic=280520.msg1381666#msg1381666
[quote author=el-brujo link=topic=280520.msg1381561#msg1381561 date=1262966701
[quote author=el-brujo link=topic=280520.msg1381561#msg1381561 date=1262966701
pues te conectas a esa web y si el servidor web devuelve un code 200 (response code) es que está todo correcto.
Y como seria eso mas o menos en php?
[/quote]
Con cURL
Código
function get_web_page( $url ) { CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle compressed CURLOPT_USERAGENT => "spider", // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect CURLOPT_TIMEOUT => 120, // timeout on response CURLOPT_MAXREDIRS => 10, // stop after 10 redirects ); $header['errno'] = $err; $header['errmsg'] = $errmsg; $header['content'] = $content; return $header; }
http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl
Código
<?php // Function to check response time function pingDomain($domain){ $status = 0; if (!$file) $status = -1; // Site is down else { $status = ($stoptime - $starttime) * 1000; } return $status; } ?>
Más:
Check website status using php and CURL library
http://php.assistprogramming.com/check-website-status-using-php-and-curl-library.html
Busca por "check website status php" y encontrarás más cosa.