<?
global $link_head;
global $link_time;
?>
<html>
<head>
<title>Redirigiendo a <?=$link_head?></title>
<meta http-equiv="refresh" content="<?=$link_time?>; URL=<?=$link_head?>">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<center>
<h1>Cargando la URL...</h1>
<br />
<img src="http://crix.us/loading.gif" />
<p>Por Favor espere <?=$link_time?> segundos mientras es redirigido hacia <strong><a href="<?=$link_head?>"><?=$link_head?></a></strong> Gracias.</p>
<?php
$url = $link_head;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $urlstring);
curl_setopt($ch, CURLOPT_REFERER, "http://www.tusitio.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
$titulo = 'No se pudo obtener el título';
if($data)
{
$ini = strpos ($html, '<title>');
$fin = strpos ($html, '</title>');
$long = $fin - $ini - 7;
$titulo = substr ($html, ($ini+7),$long);
}
echo $titulo;
// Si no se imprimen correctamente las tildes, quitar el siguiente comentario
// echo utf8_encode($titulo);
?>
<br />
</center>
<div class="clearer"></div>
</div>
</body>
</html>