Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 11-27-2003, 12:19 PM   #1 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
email address format

hopefully quick question:

i have email addresses stored in my database in the format:
name@wherever.com
but i want to show it on my site as:
name AT wherever DOT com

what would be the easiest way to do this?

thanks,
Trevor

ps - what happened to the irc chat?
trevor is offline   Reply With Quote
Old 11-27-2003, 01:02 PM   #2 (permalink)
bdl
Senior Contributor
 
Join Date: May 2002
Location: vta.ca.usa
Posts: 555
bdl is on a distinguished road
You might try str_replace().
PHP Code:
$email "bdl@codenewbie.com";
$email str_replace("@"" AT "$email);
$email str_replace("."" DOT "$email); 
bdl is offline   Reply With Quote
Old 12-20-2003, 10:04 AM   #3 (permalink)
bdonalds
Registered User
 
Join Date: Dec 2003
Posts: 5
bdonalds is on a distinguished road
You may also want to add something else to your obscured address as well. I think a lot of the address harvesting bots are wise enough to parse the AT and DOT, since it is a fairly common way to mask addresses.
bdonalds is offline   Reply With Quote
Old 12-20-2003, 04:14 PM   #4 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
what if my email address was

matt.mcinvale@z57.com ?

then it would be

matt DOT mcinvale AT z57 DOT com

that would be kinda silly looking.
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 12-22-2003, 06:08 AM   #5 (permalink)
bdonalds
Registered User
 
Join Date: Dec 2003
Posts: 5
bdonalds is on a distinguished road
Quote:
Originally posted by Admin
what if my email address was

matt.mcinvale@z57.com ?

then it would be

matt DOT mcinvale AT z57 DOT com

that would be kinda silly looking.
The reason for masking addresses is to prevent e-mail address harvesting web robots from snagging it.

Bryan
bdonalds is offline   Reply With Quote
Old 12-22-2003, 07:46 AM   #6 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
yeah, that was fairly obvious.
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 12-22-2003, 03:05 PM   #7 (permalink)
bdonalds
Registered User
 
Join Date: Dec 2003
Posts: 5
bdonalds is on a distinguished road
oh...I thought you were asking why you would want to make your address lok so silly.
bdonalds is offline   Reply With Quote
Old 12-22-2003, 03:19 PM   #8 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
i was just bringing up the fact that you can have . in the address name.
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 12-23-2003, 05:25 AM   #9 (permalink)
bdonalds
Registered User
 
Join Date: Dec 2003
Posts: 5
bdonalds is on a distinguished road
Ahhh! I had a total brain fart....I finally figured out what you meant!

Os if you want to leave the username part alone, just split it at the "@" and do the replace on the rest...

<?
$fullEmail="foo.bar@foobar.com";
$tempArray=split("@",$fullEmail);
$maskedEmail=$tempArray[0] . " AT " . str_replace("."," DOT ",$tempArray[1]);
?>

Bryan
bdonalds is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
About email spammers and fraudsters plonkeroo Lounge 21 11-16-2004 03:10 PM
Extracting Images from Email? Admin Lounge 5 06-01-2004 03:56 PM
email code aimdevil Lounge 1 05-02-2004 11:36 PM


All times are GMT -8. The time now is 03:49 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting