<?php
/*
Copyright (C) 2003 Evan McNabb
enmDespamify is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
enmDespamify is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
For a copy of the GNU General Public License go to http://www.gnu.org/licenses/gpl.html
or write to:
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
if ( $_REQUEST['submit'] )
{
draw_header();
$email_address = $_REQUEST['email_address'];
$encoded_email_address = "";
for ( $i = 0; $i < strlen( $email_address ); $i++ )
{
$encoded_email_address = $encoded_email_address . get_char_code( $email_address[$i] );
}
draw_page( $email_address, $encoded_email_address );
}
else
{
draw_header();
draw_page( "", "" );
}
function draw_page( $email_address, $encoded_email_address )
{
?>
<html>
<title>enmDespamify</title>
<body>
<div class="body">
<center><h2>enmDespamify</h2></center>
<p>One of the most common ways that spammers get e-mail addresses is through webpage harvesting.
They crawl thousands of pages looking for e-mail addresses; if they find one in the form of myuser@mydomain.com
they'll add you to their databases. For more info read this
<a href="http://www.cdt.org/speech/spam/030319spamreport.shtml">interesting study</a>.</p>
<p>enmDespamify will help you "hide" your addresses by translating them into HTML character entities (for
example 'a'=&#097; 'b'=&#098; etc).</p>
<p>Just type in your e-mail address, click encode, and the replace every occurence of your address in your webpages with
the encoded version. Your browser will render it as a normal looking e-mail address but it is MUCH harder for them
to extract while crawling your site.</p>
<p>Good luck...</p>
</div>
<? draw_form( $email_address, $encoded_email_address ); ?>
</body>
</html>
<?
}
function draw_form( $email_address, $encoded_email_address )
{
?>
<center>
<div class="form_box">
<form method='post'>
<table width="80" cellspacing="0" cellpadding="10" border="0">
<tr>
<td>E-mail address:</td>
<?
echo "<td><input type=\"Text\" name=\"email_address\" value=\"$email_address\" size=\"40\"></td>";
?>
</tr>
<br>
<br>
<tr>
<td>Encoded Address:</td>
<td><textarea rows="3" cols="60">
<?= $encoded_email_address ?>
</textarea></td>
</tr>
</table>
<p><input type="submit" name="submit" value="Encode Address"></p>
<p><input type="submit" name="clear" value="Clear Fields"></p>
</form>
</div>
</center>
<?
}
function draw_header()
{
?>
<style>
body
{
margin-left: 10px;
margin-right: 10px;
margin-top: 10px;
margin-bottom: 10px;
font-family: arial;
font-size: 80%;
}
input
{
font-size: 75%;
}
.form_box
{
font-size: 90%;
background: #e3e6f9;
border: 1px black solid;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 10px;
padding-right: 10px;
text-align: left;
width: 700px;
}
</style>
<?
}
// Return the HTML character code for a single character
function get_char_code( $char )
{
$char_array = array(
' ' => '&#032;',
'!' => '&#033;',
'"' => '&#034;',
'#' => '&#035;',
'$' => '&#036;',
'%' => '&#037;',
'&' => '&#038;',
'\'' => '&#039;',
'(' => '&#040;',
')' => '&#041;',
'*' => '&#042;',
'+' => '&#043;',
',' => '&#044;',
'-' => '&#045;',
'.' => '&#046;',
'/' => '&#047;',
'0' => '&#048;',
'1' => '&#049;',
'2' => '&#050;',
'3' => '&#051;',
'4' => '&#052;',
'5' => '&#053;',
'6' => '&#054;',
'7' => '&#055;',
'8' => '&#056;',
'9' => '&#057;',
':' => '&#058;',
';' => '&#059;',
'<' => '&#060;',
'=' => '&#061;',
'>' => '&#062;',
'?' => '&#063;',
'@' => '&#064;',
'A' => '&#065;',
'B' => '&#066;',
'C' => '&#067;',
'D' => '&#068;',
'E' => '&#069;',
'F' => '&#070;',
'G' => '&#071;',
'H' => '&#072;',
'I' => '&#073;',
'J' => '&#074;',
'K' => '&#075;',
'L' => '&#076;',
'M' => '&#077;',
'N' => '&#078;',
'O' => '&#079;',
'P' => '&#080;',
'Q' => '&#081;',
'R' => '&#082;',
'S' => '&#083;',
'T' => '&#084;',
'U' => '&#085;',
'V' => '&#086;',
'W' => '&#087;',
'X' => '&#088;',
'Y' => '&#089;',
'Z' => '&#090;',
'[' => '&#091;',
'\\' => '&#092;',
']' => '&#093;',
'^' => '&#094;',
'_' => '&#095;',
'`' => '&#096;',
'a' => '&#097;',
'b' => '&#098;',
'c' => '&#099;',
'd' => '&#100;',
'e' => '&#101;',
'f' => '&#102;',
'g' => '&#103;',
'h' => '&#104;',
'i' => '&#105;',
'j' => '&#106;',
'k' => '&#107;',
'l' => '&#108;',
'm' => '&#109;',
'n' => '&#110;',
'o' => '&#111;',
'p' => '&#112;',
'q' => '&#113;',
'r' => '&#114;',
's' => '&#115;',
't' => '&#116;',
'u' => '&#117;',
'v' => '&#118;',
'w' => '&#119;',
'x' => '&#120;',
'y' => '&#121;',
'z' => '&#122;',
'{' => '&#123;',
'|' => '&#124;',
'}' => '&#125;',
);
return $char_array[ $char ];
}
?>