Ver Mensaje Individual
  #8 (permalink)  
Antiguo 22/04/2008, 02:20
Avatar de jerkan
jerkan
 
Fecha de Ingreso: septiembre-2005
Mensajes: 1.607
Antigüedad: 21 años, 1 mes
Puntos: 19
Re: Emails anti-SPAM

Cita:
Iniciado por paulkees Ver Mensaje
Hola jerkan...

Puse en el <body> el codigo:

Código PHP:
$_GET['texto'] = "[email protected]"; ## Email que queremos proteger
$length = strlen($_GET['texto']) * 6;
header("Content-type: image/png");
$im = imagecreate($length, 14);
imagecolorallocatealpha($im, 255, 0, 0, 127);
$color = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 2, 0, 0, $_GET['texto'], $color);
imagepng($im);
imagedestroy($im); 
Lo llamé en la forma como dices, sacándole:

Código PHP:
$_GET['texto'] = "[email protected]"; 
y la pagina me queda en blanco!

Saludos.-
En tu página principal pon esto:
Código PHP:
<img src="email.php" /> 
entonces, en email.php tienes que poner esto:
Código PHP:
$_GET['texto'] = "[email protected]"; ## Email que queremos proteger
$length = strlen($_GET['texto']) * 6;
header("Content-type: image/png");
$im = imagecreate($length, 14);
imagecolorallocatealpha($im, 255, 0, 0, 127);
$color = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 2, 0, 0, $_GET['texto'], $color);
imagepng($im);
imagedestroy($im); 
Si quitas el $_GET['texto'], la función strlen tendrá un parametro vacío. Si no te funciona, comenta la linea
Código PHP:
header("Content-type: image/png"); 
y carga el script email.php en tu navegador para ver posibles errores.