Dynadot โ€” .com Transfer

How 2 put emails inside an image to stop spam

Spaceship Spaceship
Watch
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 ?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
You can do it in php with the gd2 library:

PHP:
<?php
$text = '[email protected]';

$pic = imagecreate(strlen($text) * 6, 15);

$background = imagecolorallocate($pic, 255, 255, 255); // Background color
$textcolor = imagecolorallocate($pic, 0, 0, 0); // Font color

imagestring($pic, 2, 0, 0, $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
 
1
•••
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
 
0
•••
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.

rcep said:
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
http://digitalcolony.com/lab/maskemail/maskEmailASCII.aspx
 
Last edited:
0
•••
rcep said:
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

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

Try Weblord's solution : )
 
0
•••
thanks :tu: just go for the remotely hosted then since those scripts that im gonna give you requires gd2 as well.

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

Try Weblord's solution : )
 
0
•••
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
 
0
•••
rcep said:
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 =)
 
0
•••
image.png

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.

rcep said:
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
 
0
•••
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.

Here is some php code to do something like that:

PHP:
$email = "email here"; // you would put the email field from database here.
$emailsafe = str_replace("@", "(at)", $email);
 
1
•••
TGN_Merchant said:
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.

Here is some php code to do something like that:

PHP:
$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/412189-ryans-district-directory-2-4-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
 
0
•••
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)"
 
0
•••
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:
<?
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.
$im    = imagecreatefrompng("base.PNG");
$orange = imagecolorallocate($im, 220, 210, 60);
$px    = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $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;
}
?>

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.
 
0
•••
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:
<?
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.
$im    = imagecreatefrompng("base.PNG");
$orange = imagecolorallocate($im, 220, 210, 60);
$px    = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $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. :)
 
0
•••
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:
<?
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.
$im    = imagecreatefrompng("base.PNG");
$orange = imagecolorallocate($im, 220, 210, 60);
$px    = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $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, but I got bored. :td:
 
0
•••
If your email is [email protected] , why don't let the javascript do that.
PHP:
<script type="text/javascript">
document.write('admin'+'@'+'exa'+'mple'+'.c'+'om');
</script>
I love javascript :tu:

rcep said:
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/412189-ryans-district-directory-2-4-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?
 
0
•••
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>
 
0
•••
rcep said:
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>
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.
 
0
•••
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:
<?
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.
$im    = imagecreatefrompng("base.PNG");
$orange = imagecolorallocate($im, 220, 210, 60);
$px    = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $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 was going to comment the code, but I got bored. :P
Also http://theserverpages.com/php/manual/en/ref.image.php if you need help with changing functions ect.
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back