NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page How 2 put emails inside an image to stop spam

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 12-26-2007, 07:52 AM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Jul 2005
Location: lebanon
Posts: 2,458
rcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to behold
 




How 2 put emails inside an image to stop spam


emails in an image to fight spam
Hello again
i want to fetch an email from my database and i want to place it for public inside an image to fight spam bots just like facebook they put images in images
how can do so anyone knows a simple script or idea how to do this ?
__________________
Download free MP3 _____________ Get unique visitors 4 NPs (over 800 satisfied) << Check the Holidays offer
_____ Email me for fast response ryan [at] ryansdistrict.com

________ My 9000NPs R 4 SALE cheap- Contact me!
rcep is offline  
Old 12-26-2007, 08:53 AM   #2 (permalink)
NamePros Member
 
Gray's Avatar
Join Date: Dec 2007
Posts: 26
Gray is an unknown quantity at this point
 



You can do it in php with the gd2 library:

PHP Code:
<?php
$text 
'adress@provider.tld';

$pic imagecreate(strlen($text) * 615);

$background imagecolorallocate($pic255255255); // Background color
????: NamePros.com http://www.namepros.com/programming/410946-how-2-put-emails-inside-image.html
$textcolor imagecolorallocate($pic000); // Font color

imagestring($pic200$text$textcolor);

header("Content-type: image/png");
imagepng($pic);
?>
Save it as antispam.php for example, than you call the script from your page inside a <img /> tag
Gray is offline  
Old 12-26-2007, 05:28 PM THREAD STARTER               #3 (permalink)
Senior Member
Join Date: Jul 2005
Location: lebanon
Posts: 2,458
rcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to behold
 




umm i saved that code as index.php
this error appeared
Fatal error: Call to undefined function imagecreate() in C:\wamp\www\index.php on line 4

later on i called it from another php file by
echo '<img src=index.php>';
have i done anything wrong ? cuz the images is not appearing as expected

Regards
__________________
Download free MP3 _____________ Get unique visitors 4 NPs (over 800 satisfied) << Check the Holidays offer
_____ Email me for fast response ryan [at] ryansdistrict.com

________ My 9000NPs R 4 SALE cheap- Contact me!
rcep is offline  
Old 12-26-2007, 05:34 PM   #4 (permalink)
NamePros Legend
 
weblord's Avatar
Join Date: Dec 2005
Location: Philippines - www.Nabaza.com
Posts: 19,785
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
 


Autism Protect Our Planet
try any of the remotely hosted online tools that i use
http://services.nexodyne.com/email/
http://www.signaturegenerator.net/
i have this on my computer the one that you can host, i'll look for it.
give me a moment pls..

found it something like this:
http://email.liquism.com/
they removed the downloads i still got them on my pc pm me your email and i will send it to you via attachment right away.

Originally Posted by rcep
emails in an image to fight spam
Hello again
i want to fetch an email from my database and i want to place it for public inside an image to fight spam bots just like facebook they put images in images
how can do so anyone knows a simple script or idea how to do this ?
another variable/derivative
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
http://digitalcolony.com/lab/maskema...mailASCII.aspx
__________________
Nabaza.com - Amaia
Last edited by weblord; 12-26-2007 at 05:42 PM.
weblord is offline  
Old 12-26-2007, 06:00 PM   #5 (permalink)
NamePros Member
 
Gray's Avatar
Join Date: Dec 2007
Posts: 26
Gray is an unknown quantity at this point
 



Originally Posted by rcep
umm i saved that code as index.php
this error appeared
Fatal error: Call to undefined function imagecreate() in C:\wamp\www\index.php on line 4
????: NamePros.com http://www.namepros.com/showthread.php?t=410946

later on i called it from another php file by
echo '<img src=index.php>';
have i done anything wrong ? cuz the images is not appearing as expected

Regards
The 'Fatal error' means that your php installation doesn't have the gd2 extension.

Try Weblord's solution : )
Gray is offline  
Old 12-26-2007, 06:02 PM   #6 (permalink)
NamePros Legend
 
weblord's Avatar
Join Date: Dec 2005
Location: Philippines - www.Nabaza.com
Posts: 19,785
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
 


Autism Protect Our Planet
thanks just go for the remotely hosted then since those scripts that im gonna give you requires gd2 as well.

Originally Posted by Gray
The 'Fatal error' means that your php installation doesn't have the gd2 extension.
????: NamePros.com http://www.namepros.com/showthread.php?t=410946

Try Weblord's solution : )
__________________
Nabaza.com - Amaia
weblord is offline  
Old 12-28-2007, 11:20 AM THREAD STARTER               #7 (permalink)
Senior Member
Join Date: Jul 2005
Location: lebanon
Posts: 2,458
rcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to behold
 




umm actually remotly hosted scripts will not work as they should i checked the one weblord posted i dont think will solve my problem
i want to directly fetch the result and through it inside the images
i tried it on an other server
take a look at the errors am getting
http://ryansdistrict.com/temp/ << code page
http://ryansdistrict.com/temp/index2.php << result
__________________
Download free MP3 _____________ Get unique visitors 4 NPs (over 800 satisfied) << Check the Holidays offer
_____ Email me for fast response ryan [at] ryansdistrict.com

________ My 9000NPs R 4 SALE cheap- Contact me!
rcep is offline  
Old 12-28-2007, 01:23 PM   #8 (permalink)
NamePros Member
 
Gray's Avatar
Join Date: Dec 2007
Posts: 26
Gray is an unknown quantity at this point
 



Originally Posted by rcep
umm actually remotly hosted scripts will not work as they should i checked the one weblord posted i dont think will solve my problem
i want to directly fetch the result and through it inside the images
i tried it on an other server
take a look at the errors am getting
http://ryansdistrict.com/temp/ << code page
http://ryansdistrict.com/temp/index2.php << result
header() function must be called before any html output. Maybe you have a blank line at the top of your file or something =)
Gray is offline  
Old 12-28-2007, 04:46 PM   #9 (permalink)
NamePros Legend
 
weblord's Avatar
Join Date: Dec 2005
Location: Philippines - www.Nabaza.com
Posts: 19,785
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
 


Autism Protect Our Planet

first one works
if you only need to generate once it's not practical to install on your site, but otherwise if you're offering the free services on your site then it's ok.

Originally Posted by rcep
umm actually remotly hosted scripts will not work as they should i checked the one weblord posted i dont think will solve my problem
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
i want to directly fetch the result and through it inside the images
i tried it on an other server
take a look at the errors am getting
http://ryansdistrict.com/temp/ << code page
http://ryansdistrict.com/temp/index2.php << result
__________________
Nabaza.com - Amaia
weblord is offline  
Old 12-29-2007, 05:35 PM   #10 (permalink)
NamePros Regular
Join Date: May 2005
Posts: 330
TGN_Merchant is an unknown quantity at this point
 



This doesn't solve his problem. He needs to grab emails from his database meaning he doesn't actually know what the results will be, as well as the fact that that service only provides images for certain email services like gmail, aol, etc.

I would contact your host about enabling GD Library if I were you. You could make something like the following:

emailname(at)something.com so its not a link.
????: NamePros.com http://www.namepros.com/showthread.php?t=410946

Here is some php code to do something like that:

PHP Code:
$email "email here"// you would put the email field from database here.
$emailsafe str_replace("@""(at)"$email); 
TGN_Merchant is offline  
Old 12-29-2007, 05:47 PM THREAD STARTER               #11 (permalink)
Senior Member
Join Date: Jul 2005
Location: lebanon
Posts: 2,458
rcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to behold
 




Originally Posted by TGN_Merchant
This doesn't solve his problem. He needs to grab emails from his database meaning he doesn't actually know what the results will be, as well as the fact that that service only provides images for certain email services like gmail, aol, etc.
????: NamePros.com http://www.namepros.com/showthread.php?t=410946

I would contact your host about enabling GD Library if I were you. You could make something like the following:

emailname(at)something.com so its not a link.

Here is some php code to do something like that:

PHP Code:
$email "email here"// you would put the email field from database here.
$emailsafe str_replace("@""(at)"$email); 
your method might solve the problem but looks simple and do actualy people like showing there emails like that ?
what i am going to use this is for the next update of http://www.namepros.com/programming/...-released.html
i want to include it on the site's details page for people to contact webmaster when they link exchange
Do u think using the (at) thing a good idea
__________________
Download free MP3 _____________ Get unique visitors 4 NPs (over 800 satisfied) << Check the Holidays offer
_____ Email me for fast response ryan [at] ryansdistrict.com

________ My 9000NPs R 4 SALE cheap- Contact me!
rcep is offline  
Old 12-29-2007, 06:04 PM   #12 (permalink)
NamePros Regular
Join Date: May 2005
Posts: 330
TGN_Merchant is an unknown quantity at this point
 



I have seen it on plenty of sites. Without the use of GD Library to produce an image of it, it basically would be the only way around it. Maybe adding spaces instead like:

name @ email.com??

The same thing just with " " instead of "(at)"
TGN_Merchant is offline  
Old 12-30-2007, 04:20 PM   #13 (permalink)
New Member
Join Date: Dec 2007
Posts: 11
RobZ1337 is an unknown quantity at this point
 



I gave it a go:
http://www.zero-cms.com/Test/gdlib/test.php
As you can see that method works, and I can't imagine it being much harder replacing $string (The string that is added to the image) with a result from a mysql query.

Here's the sauce:
PHP Code:
<?
if (isset($_POST['email1']) && isset($_POST['email2']) && isset($_POST['email3'])) { //Checks to see the the POST vars have been set
header("Content-type: image/png");
$email1 $_POST['email1']; //Makes a local variable to the post var of the same name
$email2 $_POST['email2']; //^^
$email3 $_POST['email3']; //^^
$string $email1 "@" $email2 "." $email3//Joins all $_POST variables returned from form below.
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
$im    imagecreatefrompng("base.PNG");
$orange imagecolorallocate($im22021060);
$px    = (imagesx($im) - 7.5 strlen($string)) / 2;
imagestring($im3$px9$string$orange);
imagepng($im);
imagedestroy($im);
}
else
{
$content "<html>
    <head>
        <title>GDLib Test</title>
    </head>
    <body>
        <div>
            <fieldset><legend>Please enter your email address</legend>
                <form method=\"POST\" action=" 
.$_SERVER['PHP_SELF']. ">
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
                    <input type=\"text\" name=\"email1\" /> @ <input type=\"text\" name=\"email2\" /> . <input type=\"text\" name=\"email3\" />
                    <br />
                    <input type=\"submit\" value=\"Submit\" />
                </form>
            </fieldset>
        </div>
    </body>
</html>"
;
echo 
$content;
}
?>
PHP.Net is fabulous for things like this, also check http://theserverpages.com/php/manual/en/ref.image.php.

As you can see, I started to comment the code, although I got bored. =[

Rob.
RobZ1337 is offline  
Old 12-30-2007, 06:32 PM   #14 (permalink)
New Member
Join Date: Dec 2007
Posts: 11
RobZ1337 is an unknown quantity at this point
 



I had a go of this myself:
http://www.zero-cms.com/Test/gdlib/test.php

Now this works, and I don't see why setting $string (the variable that is printed to the image) to a result from a MYSQL query would be difficult.

Here's the Sauce:

PHP Code:
<?
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
if (isset($_POST['email1']) && isset($_POST['email2']) && isset($_POST['email3'])) { //Checks to see the the POST vars have been set
header("Content-type: image/png");
$email1 $_POST['email1']; //Makes a local variable to the post var of the same name
$email2 $_POST['email2']; //^^
$email3 $_POST['email3']; //^^
$string $email1 "@" $email2 "." $email3//Joins all $_POST variables returned from form below.
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
$im    imagecreatefrompng("base.PNG");
$orange imagecolorallocate($im22021060);
$px    = (imagesx($im) - 7.5 strlen($string)) / 2;
imagestring($im3$px9$string$orange);
imagepng($im);
imagedestroy($im);
}
else
{
$content "<html>
    <head>
        <title>GDLib Test</title>
    </head>
    <body>
        <div>
            <fieldset><legend>Please enter your email address</legend>
                <form method=\"POST\" action=" 
.$_SERVER['PHP_SELF']. ">
                    <input type=\"text\" name=\"email1\" /> @ <input type=\"text\" name=\"email2\" /> . <input type=\"text\" name=\"email3\" />
                    <br />
                    <input type=\"submit\" value=\"Submit\" />
                </form>
            </fieldset>
        </div>
    </body>
</html>"
;
echo 
$content;
}
?>
I tried to comment the code, but I got bored.

Do with it what you will.
RobZ1337 is offline  
Old 12-30-2007, 10:01 PM   #15 (permalink)
New Member
Join Date: Dec 2007
Posts: 11
RobZ1337 is an unknown quantity at this point
 



Test


Have a look at this.
http://www.zero-cms.com/Test/gdlib/test.php
It would be easy enough to change the string to come from a mysql query.

Source:
PHP Code:
<?
if (isset($_POST['email1']) && isset($_POST['email2']) && isset($_POST['email3'])) { //Checks to see the the POST vars have been set
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
header("Content-type: image/png");
$email1 $_POST['email1']; //Makes a local variable to the post var of the same name
$email2 $_POST['email2']; //^^
$email3 $_POST['email3']; //^^
$string $email1 "@" $email2 "." $email3//Joins all $_POST variables returned from form below.
$im    imagecreatefrompng("base.PNG");
$orange imagecolorallocate($im22021060);
$px    = (imagesx($im) - 7.5 strlen($string)) / 2;
imagestring($im3$px9$string$orange);
imagepng($im);
imagedestroy($im);
}
else
{
$content "<html>
    <head>
        <title>GDLib Test</title>
    </head>
    <body>
        <div>
            <fieldset><legend>Please enter your email address</legend>
                <form method=\"POST\" action=" 
.$_SERVER['PHP_SELF']. ">
                    <input type=\"text\" name=\"email1\" /> @ <input type=\"text\" name=\"email2\" /> . <input type=\"text\" name=\"email3\" />
                    <br />
                    <input type=\"submit\" value=\"Submit\" />
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
                </form>
            </fieldset>
        </div>
    </body>
</html>"
;
echo 
$content;
}
?>
I tried to comment, but I got bored.
RobZ1337 is offline  
Old 12-31-2007, 02:06 AM   #16 (permalink)
i love automation
 
xrvel's Avatar
Join Date: Nov 2007
Location: xrvel.com
Posts: 1,620
xrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant future
 





If your email is admin@example.com , why don't let the javascript do that.
PHP Code:
<script type="text/javascript">
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
document.write('admin'+'@'+'exa'+'mple'+'.c'+'om');
</script> 
I love javascript

Originally Posted by rcep
your method might solve the problem but looks simple and do actualy people like showing there emails like that ?
what i am going to use this is for the next update of http://www.namepros.com/programming/...-released.html
i want to include it on the site's details page for people to contact webmaster when they link exchange
Do u think using the (at) thing a good idea
Btw, have you tried PHP GD?
__________________
xrvel is offline  
Old 12-31-2007, 03:01 AM THREAD STARTER               #17 (permalink)
Senior Member
Join Date: Jul 2005
Location: lebanon
Posts: 2,458
rcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to behold
 




GD didnt work not sure why although other scripts i got running on that server got image verification

anyways does the code below prevent spammers ?
<script type="text/javascript">
document.write('admin'+'@'+'exa'+'mple'+'.c'+'om') ;
</script>
__________________
Download free MP3 _____________ Get unique visitors 4 NPs (over 800 satisfied) << Check the Holidays offer
_____ Email me for fast response ryan [at] ryansdistrict.com

________ My 9000NPs R 4 SALE cheap- Contact me!
rcep is offline  
Old 12-31-2007, 03:12 AM   #18 (permalink)
i love automation
 
xrvel's Avatar
Join Date: Nov 2007
Location: xrvel.com
Posts: 1,620
xrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant future
 




Originally Posted by rcep
GD didnt work not sure why although other scripts i got running on that server got image verification
????: NamePros.com http://www.namepros.com/showthread.php?t=410946

anyways does the code below prevent spammers ?
<script type="text/javascript">
document.write('admin'+'@'+'exa'+'mple'+'.c'+'om') ;
</script>
Ok, i just uploaded an online gd script, :
http://www.tracenic.com/xrvel/gd/draw.php?t={TEXT}

for example is you want to generate image "hello_world", replace {TEXT} with "hello_world".

Next, save the image to local disk & upload it somewhere else. & you can use it in forum, etc.

About the javascript, it works imo.
__________________
xrvel is offline  
Old 12-31-2007, 05:34 AM   #19 (permalink)
New Member
Join Date: Dec 2007
Posts: 11
RobZ1337 is an unknown quantity at this point
 



Bah, it hasn't been letting me post in this forum since I first joined.
http://www.zero-cms.com/Test/gdlib/test.php
If you want the files PM me, and i'll send them to you.
It should be very easy to replace the string that is placed on the image with a result from a MYSQL query.
PHP Code:
<?
if (isset($_POST['email1']) && isset($_POST['email2']) && isset($_POST['email3'])) { //Checks to see the the POST vars have been set
header("Content-type: image/png");
$email1 $_POST['email1']; //Makes a local variable to the post var of the same name
$email2 $_POST['email2']; //^^
$email3 $_POST['email3']; //^^
$string $email1 "@" $email2 "." $email3//Joins all $_POST variables returned from form below.
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
$im    imagecreatefrompng("base.PNG");
$orange imagecolorallocate($im22021060);
$px    = (imagesx($im) - 7.5 strlen($string)) / 2;
imagestring($im3$px9$string$orange);
imagepng($im);
imagedestroy($im);
}
else
{
$content "<html>
????: NamePros.com http://www.namepros.com/showthread.php?t=410946
    <head>
        <title>GDLib Test</title>
    </head>
    <body>
        <div>
            <fieldset><legend>Please enter your email address</legend>
                <form method=\"POST\" action=" 
.$_SERVER['PHP_SELF']. ">
                    <input type=\"text\" name=\"email1\" /> @ <input type=\"text\" name=\"email2\" /> . <input type=\"text\" name=\"email3\" />
                    <br />
                    <input type=\"submit\" value=\"Submit\" />
                </form>
            </fieldset>
        </div>
    </body>
</html>"
;
echo 
$content;
}
?>
I was going to comment the code, but I got bored.
Also http://theserverpages.com/php/manual/en/ref.image.php if you need help with changing functions ect.
RobZ1337 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 04:43 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger