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; 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]
<?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; 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]