note 41352 deleted from function.imagejpeg by cmb
| From: | cmb@php.net | Date: | Sun, 02 Oct 2016 08:03:08 +0000 |
| Subject: | note 41352 deleted from function.imagejpeg by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206730@lists.php.net to get a copy of this message | ||
Note Submitter: Olav Alexander Mjelde
----
Some people have never heard of spambots, searching the net for email adresses.
How do you avoid this?
Some people write emails like: olav-x AT volvo-power.net (mine btw),
but this will confuse "stupid" users.
The optimal sollution is to have an image with your email adress on.
* When using this function,
you have to put it in a non-html php file..
eg. I put it in a makeimage.php file.
so, how do you display it?
In your users.php, put this:
echo "<b>Email:</b>
<img src=\"/sql/phpPictures/makeimage.php
?string={$row['email']}\">";
Below is the makeimage.php (working example)
<?php
header("Content-type: image/jpg");
if (!isset($string))
{
$string = "Missing data";
}
$font = 4;
$width = ImageFontWidth($font) * strlen($string);
$height = ImageFontHeight($font);
$im = @imagecreate ($width,$height);
//white background
$background_color = imagecolorallocate
($im, 255, 255, 255);
//black text
$text_color = imagecolorallocate ($im, 0, 0,0);
imagestring ($im, $font, 0, 0, $string, $text_color);
imagejpeg ($im);
?>
Enjoy..