- --- fichier pour appeler la fonction crypt_mail
-
- <?php
- function cryptit($nom,$dom,$ext){
-
- $plain = $nom."-A-".$dom."-D-".$ext;
- $size = strlen($plain);
-
- $lettres = "abcdefghijklmnopqrstuvwxyz123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- $len = strlen($lettres);
-
- for ($i=0;$i<$size;$i++){
- $l1 .= substr($lettres,(rand()%($len)),1);
- $l1 .= substr($plain, $i, 1);
- }
- return $l1;
- }
-
- ?>
-
- <HTML><TITLE>Adresse mail dans Image</TITLE>
- <BODY bgcolor=#ccddee>
- Hello tout le monde! mon adesse mail est
- <IMG SRC="crypt_mail.php?mail=<?echo cryptit("odette","hotmail","com");?>"><br />
-
- Une seconde adresse:
- <IMG SRC="crypt_mail.php?mail=<?echo cryptit("alphonse","yahoo","fr");?>">
-
- </BODY></HTML>
-
- --- fichier avec la fonction crypt_mail
-
- <?php
- function im_mail($m){
-
- $col1 = 1+rand()%254;
- $col2 = 1+rand()%254;
- $col3 = 1+rand()%254;
- $font = 5;
- $image = imagecreate(strlen($m)*imagefontwidth($font),imagefontheight($font));
- $fond = imagecolorallocate($image, $col1, $col2, $col3);
- $pix = imagecolorallocate($image, $col1/2, $col2/2, $col3/2);
- $noir = imagecolorallocate($image, 0, 0, 0);
- $blanc = imagecolorallocate($image, 255, 255, 255);
- $gris = imagecolorallocate($image, 160, 160, 160);
-
- for ($i=0;$i<240;$i++){
- imagesetpixel ($image, rand()%(strlen($m)*imagefontwidth($font)), rand()%imagefontheight($font), $pix);
- }
- imagestring($image, $font, 0, -1, $m, $noir);
- imagestring($image, $font, 2, -1, $m, $noir);
- imagestring($image, $font, 0, 1, $m, $noir);
- imagestring($image, $font, 2, 1, $m, $noir);
-
- imagestring($image, $font, 1, 0, $m, $blanc);
-
- for ($i=0;$i<80;$i++){
- imagesetpixel ($image, rand()%(strlen($m)*imagefontwidth($font)), rand()%imagefontheight($font), $gris);
- }
-
- header("Content-type: image/jpeg");
- imagejpeg($image);
- imagedestroy($image);
- }
-
- $mail = $_GET['mail'];
- $size = strlen($mail);
- for ($i=0;$i<$size;$i++){
- $l1 .= substr($mail,2*$i+1,1);
- }
- $mail= $l1;
- $mail = preg_replace("/\-D-/",".",$mail);
- $mail = preg_replace("/\-A-/","@",$mail);
- im_mail($mail);
- ?>
--- fichier pour appeler la fonction crypt_mail
<?php
function cryptit($nom,$dom,$ext){
$plain = $nom."-A-".$dom."-D-".$ext;
$size = strlen($plain);
$lettres = "abcdefghijklmnopqrstuvwxyz123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$len = strlen($lettres);
for ($i=0;$i<$size;$i++){
$l1 .= substr($lettres,(rand()%($len)),1);
$l1 .= substr($plain, $i, 1);
}
return $l1;
}
?>
<HTML><TITLE>Adresse mail dans Image</TITLE>
<BODY bgcolor=#ccddee>
Hello tout le monde! mon adesse mail est
<IMG SRC="crypt_mail.php?mail=<?echo cryptit("odette","hotmail","com");?>"><br />
Une seconde adresse:
<IMG SRC="crypt_mail.php?mail=<?echo cryptit("alphonse","yahoo","fr");?>">
</BODY></HTML>
--- fichier avec la fonction crypt_mail
<?php
function im_mail($m){
$col1 = 1+rand()%254;
$col2 = 1+rand()%254;
$col3 = 1+rand()%254;
$font = 5;
$image = imagecreate(strlen($m)*imagefontwidth($font),imagefontheight($font));
$fond = imagecolorallocate($image, $col1, $col2, $col3);
$pix = imagecolorallocate($image, $col1/2, $col2/2, $col3/2);
$noir = imagecolorallocate($image, 0, 0, 0);
$blanc = imagecolorallocate($image, 255, 255, 255);
$gris = imagecolorallocate($image, 160, 160, 160);
for ($i=0;$i<240;$i++){
imagesetpixel ($image, rand()%(strlen($m)*imagefontwidth($font)), rand()%imagefontheight($font), $pix);
}
imagestring($image, $font, 0, -1, $m, $noir);
imagestring($image, $font, 2, -1, $m, $noir);
imagestring($image, $font, 0, 1, $m, $noir);
imagestring($image, $font, 2, 1, $m, $noir);
imagestring($image, $font, 1, 0, $m, $blanc);
for ($i=0;$i<80;$i++){
imagesetpixel ($image, rand()%(strlen($m)*imagefontwidth($font)), rand()%imagefontheight($font), $gris);
}
header("Content-type: image/jpeg");
imagejpeg($image);
imagedestroy($image);
}
$mail = $_GET['mail'];
$size = strlen($mail);
for ($i=0;$i<$size;$i++){
$l1 .= substr($mail,2*$i+1,1);
}
$mail= $l1;
$mail = preg_replace("/\-D-/",".",$mail);
$mail = preg_replace("/\-A-/","@",$mail);
im_mail($mail);
?>