<?php
error_reporting(0);
/* Limpia la variable que queramos */
function limpia($a){
/* Quita http:// */
$a = str_replace("http://","",$a);
/* Limpia caracteres html */
$a = htmlspecialchars($a, ENT_QUOTES);
return $a;
}
/* Obtiene el nombre de la pagina en que estara el script */
$servidor = $_SERVER['HTTP_HOST'];
/* Obtiene la carpeta donde esta el script */
$path = $_SERVER['PHP_SELF'];
/* obtiene el valor de nuestra variable xD */
$page = @$_GET['page'];
$var = @$_GET['url'];
/* Limpia la variable usando la funcion anterior */
$var = limpia($var);
$page = limpia($page);
$var = base64_encode($var);
/* Si $var esta vacia se muestra el formulario
para ingresar una direccion */
/* Si $page esta vacia entonces pregunta por $var xD */
If (empty($page)){
/* Si $var esta vacia muestra el formulario para ingresar una direccion */
if(empty($var)){
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Anonimizer - Inicio</title>
</head>
<body>
<form action="" method="get">
<b>Ingrese una dirección</b><br />
<input type="text" name="url">
<input type="submit" value="Anonimizar!">
</form>
</body>
</html>
';
/* Si $var no esta vacia muestra los enlaces para que el usuario sepa que enlaces
poner en foros o en su sitio */
}else{
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Anonimizer - Obtener</title>
</head>
<body>
<form>
<b>Enlace directo:</b><br />
<input size="60" type="text" value="http://',$servidor,$path,'?page=',$var,'"><br />
<br /><b>Enlace HTML para sitios web y blogs:</b><br />
<textarea rows="4" cols="50"><a href="http://',$servidor,$path,'?page=',$var,'" title="Enlace anonimo" target="_blank">Enlace anonimizado!</a></textarea><br />
<br /><b>Enlace Para foros (bbcode):</b><br />
<textarea rows="4" cols="50">Enlace anonimizado!</textarea><br />
</form><br /><br />
<a href="http://',$servidor,$path,'?page=',$var,'" target="_blank">Probar enlace</a>
</body>
</html>
';
}
/* Si $page tiene un valor entonces muestra el valor anonimizado xD
*/
}else{
$page = base64_decode($page);
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META HTTP-EQUIV="REFRESH" CONTENT="6;URL=http://',$page,'">
<title>Anonimizer - Obtener</title>
</head>
Por favor espere 5 segundos o haga click <a href="http://',$page,'">aqui</a>
</body>
</html>
';
}
?>