InicioInfoConvertir texto, email, correo a imagen y evitar spam - PHP
Hola a todos, iré directo al grano. Lo primero que tienen que hacer es copiar el siguiente código a un archivo txt:

<?php
/**
/***********************************************
* Email Address Image
* by Scott Weaver
*
* Last updated: February 27th, 2009 @ 2:30pm
*
* Converts an e-mail address to an image to
* prevent spam bots and scrapers from stealing
* it.
*
***********************************************/

/*
Requires two inputs:

u : is the username part of the email address
d : is the domain part of the email address
*/
if( !isset($_GET['u']) || !isset($_GET['d']) )
die('Please enter a valid e-mail address.');

$email = $_GET['u'] . '@' . $_GET['d'];

/*
For this font, the width is 6X the character length,
plus 1 for padding.
*/
$width = (strlen( $email )*6)+1;

// Create image w/ color
$im = imagecreate($width, 14)
or die('Cannot initialize new GD image stream');
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);

// Write email address to image
imagestring($im, 2, 1, 0, $email, $black);

// Output &amp;amp;amp;amp; destroy
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>


Luego, guardan este archivo en la raíz de su hosting con el nombre de emailimg.php

Se supone que tienen que cambiar la extensión txt a php (Creo que eso es más que evidente).

Luego, cuando quieran cambiar un email a texto sólo copien y peguen lo siguiente en la vista código de su página (donde quieren que vaya el correo cambiado):

<img title="AQUI PONEN EL TITULO DE SU IMAGEN" src="emailimg.php?d=midominio.com&u=nombredeusuario" width="150" height="16" />

- Se mostrará una imagen del correo tipo: [email protected]



Datos archivados del Taringa! original
0puntos
2,593visitas
0comentarios
Actividad nueva en Posteamelo
0puntos
3visitas
0comentarios
Dar puntos:

Dejá tu comentario

0/2000

Autor del Post

7
713win6🇦🇷
Usuario
Puntos0
Posts4
Ver perfil →
PosteameloArchivo Histórico de Taringa! (2004-2017). Preservando la inteligencia colectiva de la internet hispanohablante.

CONTACTO

18 de Septiembre 455, Casilla 52

Chillán, Región de Ñuble, Chile

Solo correo postal

© 2026 Posteamelo.com. No afiliado con Taringa! ni sus sucesores.

Contenido preservado con fines históricos y culturales.