Link to home
Create AccountLog in
Avatar of kamileris
kamileris

asked on

How to create IMAGES to secure EMAIL address Easy question!

Hello,
I have this webpage with user registration when somebody registers only if they want to show their email address to other users that email address will show like myemail@myemail.com I want to make this secure for my users even thought its an option for them to allow their email address public, I want to make this like in image format so no bots can detect it like the one you can see for example http://whois.domaintools.com/experts-exchange.com
If you take a look contact email address has been secured in image format
How can i do something like this one?
Thank you
Avatar of Andrew P
Andrew P
Flag of United Kingdom of Great Britain and Northern Ireland image

Have a look at this link

http://www.13337.org/php-create-image-from-string/

Any Use?

Greenclock
Avatar of shadow_shooter
shadow_shooter

It's very easy. Let me explain you step by step in my next post.
Avatar of kamileris

ASKER

I am checking right now thank you
Greenclock
this is good only when you are using one thing to create, do you know anything that will automaticly create images for example for: <?=ascii_str($user['email'])?>

shadow_shooter
I would like to know Thank you
ASKER CERTIFIED SOLUTION
Avatar of shadow_shooter
shadow_shooter

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Forgot to add,

At the end you should output this image to browser by imagejpeg() function. Simply, it needs the $bgimage variable that we used.

imagejpeg($bgimage);

Do this coding in a php file, called emailtext.php

Then you should call this php file as if you were adding an image:

<img src="emailtext.php" />

This time, it's done. :)

If you need assistance you can write me back, don't be afraid of code work. Try to understand what I wrote, u'll see it's simple and you can do it!
At the end it's like:


<?php
#This a file called emailtext.php
 
$bgimage=imagecreatefrompng("images/background.png");
$font="fonts/yourfont.ttf";
$color=imagecolorallacote($bgimage, 122, 229, 112); //change the colors to desired ones.
$size=12;
$angle=0;
$coordinateX=10;
$coordinateY=$size+10;
$text=$EMAIL_ADDRESS
 
imagettftext($bgimage, $size, $angle, $coordinateX, $coordinateY, $color, $font, $text);
imagejpeg($bgimage);
?>

Open in new window

I will be checking right now give me 15 min thank you so much!
Okay, I'm waiting.
How can i put this into:
<?=ascii_str($user['email'])?>

$text=$EMAIL_ADDRESS

Thank you!
I recommend you to use Session variables. First add session_start(); to both startings of the codings in two pages. Then set $_SESSION['emailtext']=$user['email']; in the page where your image will be shown.

In the emailtext.php, change the code as the following:

$text=$_SESSION['emailtext'];

and you're done.
I will be checking it soon but thank you for your time I appreciated and I will be giving you points Thank you so much since this is actually using ascii in html I might just forget about doing this if I cant get it to work. Thank you!
I wish I helped you more. Good luck!
hey man you helped me much as you could! and i really appreciated! you wrote down whole list of code for me plus the description i wish i can be like you guys one day! i am tring to get my self in good college for computer science after two years of working full time at some fast food store...
I'm sure you'll do the best, just keep reading, have the soul of succeeding in things, never and ever throw in the towel then u'r ready!