Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-2006, 01:28 PM
kromagnon kromagnon is offline
Learning Programmer
 
Join Date: Jun 2006
Posts: 53
Rep Power: 9
kromagnon is on a distinguished road
Default Validating an email address

If I have a form where a user needs to put in an email address, how can I test that to make sure that it is in fact an email address (something@somewhere) and not just crap(crapcrapcrap)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-21-2006, 02:22 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,203
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

PHP Code:
<?PHP
///////////////////////////////////////////////////////////////////////
// Author: Jordan
// Date: 9-30-05
// Copyright: 2005
// Description: Validates email addresses inside
//     of a function call
///////////////////////////////////////////////////////////////////////

// take a given email address and split it into the  
// username and domain.

function ValidateEmail($v_email)
{

    list(
$v_userName$v_mailDomain) = split("@"$v_email);
    if (
ValidateEmail2($v_mailDomain"MX")) {
         
// this is a valid email domain!
        
return true;
    }

    else {
          
// this email domain doesn't exist! bad dog! no biscuit!
          
return false;
    }

}
?>
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!

Last edited by Jordan; 07-21-2006 at 02:28 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-30-2006, 11:24 AM
Lop's Avatar   
Lop Lop is offline
Speaks fluent binary
 
Join Date: May 2006
Posts: 1,149
Rep Power: 18
Lop will become famous soon enoughLop will become famous soon enough
Default

Jordan, you have a function in there ValidateEmail2 that isn't in your code above. This function wont run.
__________________
Lop
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: Validate Email Address Jordan PHP Tutorials 26 05-22-2008 01:15 PM
PHP:Tutorial - Email Verification John PHP Tutorials 3 09-19-2007 01:19 PM
Dynamic Email insertion in HTML Gibster HTML Programming 5 07-17-2007 05:22 PM
WARNING: New e-gold phishing email andrew Business and Legal 3 04-27-2007 12:54 PM


All times are GMT -5. The time now is 05:19 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads