Código PHP:
session_start();
function getResults($first, $end)
{
static $default = '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script>
function nueva_ventana(url, ancho, alto, barra) {
izquierda = (screen.width) ? (screen.width-ancho)/2 : 100
arriba = (screen.height) ? (screen.height-alto)/2 : 100
opciones = \'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=\' + barra + \',resizable=1,width=\' + ancho + \',height=\' + alto + \',left=\' + izquierda + \',top=\' + arriba + \'\'
window.open(url, \'popUp2\', opciones)
}
</script>
<title>Detalles Eventos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" ><tr><td align="justify" width="10%" valign="top"></table>
</body>
</html>';
for ($i=$first; $i <= $end; $i++)
{
if (!isset($_SESSION['results'][$i]))
{
$file = file_get_contents('http://www.renaultclub.com.ve/detalles_eventos.php?id='.$i);
$_SESSION['results'][$i] = $file == $default ? false : true;
}
echo 'ID: '.$i.' - '.($_SESSION['results'][$i] ? 'OK' : '<strong>NOK</strong>').'<br />';
flush();
ob_flush();
}
}
getResults(155, 165);