GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 16-May-2003, 11:23
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough

E-mail address cloaker


Found this and its under the GPL so here you go.

PHP Code:

<?php
/*
* email_address_cloaker.php
*
* Author: Steve Werby <steve at(@) befriend dot(.) com>
* Created: 2000-11-24
* Revised: 2001-02-16
*
* Purpose: Cloaks an email address to reduce harvesting by spambots.
*
* Latest version always available at http://www.befriend.com/
*********************************************************************/

// Obfuscates an email address to reduce harvesting by spambots
// by cloaking the email address by replacing dots and at signs
// with HTML entitities, words and spaces in order to generate
// a human-comprehendable email address.
//
// There are a practically unlimited number of variations possible
// so feel free to edit to suit your needs and make spammers' jobs
// that much more difficult!
//
// As written if a style isn't supplied as a parameter then the
// first case is used and if an invalid style is specified the
// second case is used.

function email_address_cloaker( $email, $style = 1 ) 
{    
    switch( $style )
    {
        case 1:
            $cloaked = str_replace( "@", "&nbsp;at&nbsp;", $email );
            $cloaked = str_replace( ".", "&nbsp;dot&nbsp;", $cloaked );
            break;
        case 2:
        default:
            $cloaked = str_replace( "@", "&nbsp;at(@)&nbsp;", $email ); 
            $cloaked = str_replace( ".", "&nbsp;dot(.)&nbsp;", $cloaked ); 
            break;
    }       
    
    return $cloaked;
}

/*
* Usage of email_address_cloaker().
*********************************************************************/

echo email_address_cloaker( 'user@somewhere.com', 2 );
  
?>

 
 

Recent GIDBlogWelcome to Baghdad by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
tracking city and country from IP address s786787 Web Design Forum 5 06-Nov-2003 23:23
Rebase - Must Get! BobbyDouglas Miscellaneous Programming Forum 0 18-Aug-2003 04:57
any one knows about the address of the deleted files in FAT shaam C++ Forum 1 09-Aug-2003 16:18
600MB Space, 20GB Banwidth, PHP, MySQL, CGI, SSH, FrontPage, FTP, POP3, Web Mail fcolor Web Hosting Advertisements & Offers 0 08-Aug-2003 10:11
E Mail Forwarding nikkotash Computer Software Forum - Windows 3 30-Jun-2003 03:20

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 21:10.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.