note 41352 added to function.imagejpeg
| From: | OlavAlexanderMjelde at rn2 dot php dot net | Date: | Wed, 07 Apr 2004 10:24:13 +0000 |
| Subject: | note 41352 added to function.imagejpeg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67756@lists.php.net to get a copy of this message | ||
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..
----
Manual Page -- http://www.php.net/manual/en/function.imagejpeg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41352
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41352&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41352&report=yes
Search -- http://master.php.net/manage/user-notes.php