Page 1 of 1

scramble emailaddress

Posted: Fri Sep 24, 2010 4:01 am
by clonemaster
Hi,
I have a form for a guestbook, where visitors of the website can leave a message, including their emailaddress.
All input is written to a txt file which is displayed on the page where the form is.
Is there a way to display the emailadress funtional but not readable for spambots?
This is the code that read the txt file:

Code: Select all

<?
          $gastenboek=array_reverse($gastenboek);
          for ($i=$start;$i<$start+$amount && $i<sizeof($gastenboek);$i++) {
            list($name,$email,$date,$url,$message)=explode('|||',$gastenboek[$i]);
            $message=str_replace('{{',"\n",$message);
            echo '<TR><TD><B>'.($email!=""?'<A href="mailto:'.$email.'">'.$name.'</A>':$name).'</B></TD><TD align="right"><B>'.$date.'</B></TD></TR>'."\n";
            echo ($url!=""?'<TR><TD colspan="2"><A href="'.$url.'" target="_blank">'.$url.'</A></TD></TR>':'')."\n";
            echo '<TR><TD colspan="2"><SPAN>'.str_replace("\n",'<BR>',htmlspecialchars($message)).'</SPAN></TD></TR>'."\n";
            echo '<TR><TD colspan="2"><HR></TD></TR>'."\n";
          }
        ?>
Thanks for helping out :bow:

Re: scramble emailaddress

Posted: Fri Sep 24, 2010 4:35 am
by requinix
Apparently you didn't preview your post before submitting it. Check your code: that look right?
Use

Code: Select all

 tags instead of [php]. There's a "PHP Code" button for you to use as well.

The term is "obfuscation", as in the phrase "[url=http://www.google.com/search?q=obfuscate+email+address]obfuscate email address[/url]".

Re: scramble emailaddress

Posted: Fri Sep 24, 2010 12:35 pm
by John Cartwright
tasairis wrote:Apparently you didn't preview your post before submitting it. Check your code: that look right?
Use

Code: Select all

 tags instead of [php]. There's a "PHP Code" button for you to use as well.

The term is "obfuscation", as in the phrase "[url=http://www.google.com/search?q=obfuscate+email+address]obfuscate email address[/url]".[/quote]

Fixed.

Also see http://www.csarven.ca/hiding-email-addresses

Re: scramble emailaddress

Posted: Fri Sep 24, 2010 5:41 pm
by clonemaster
Now that's the reply I was waiting for !
Thank you so much for pointing this out for me.
I wasn't aware of those tags..
Phew... imagine how I must feel now.

:crazy:

Thought this was a forum where people helped eachother with coding questions..
Must be my mistake..