Lost Password?

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

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

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, 12:28 PM
kromagnon kromagnon is offline
Learning Programmer
 
Join Date: Jun 2006
Posts: 53
Credits: 0
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, 01:22 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,302
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
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;
    }

}
?>
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Don't hesitate to ask any questions that you have! Check out our
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
!

Last edited by Jordan; 07-21-2006 at 01: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, 10:24 AM
Lop's Avatar   
Lop Lop is offline
Speaks fluent binary
 
Join Date: May 2006
Posts: 1,149
Credits: 112
Rep Power: 16
Lop 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

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


All times are GMT -5. The time now is 11:34 PM.

Contest Stats

Xav ........ 1276.19
MeTh0Dz|Reb0rn ........ 1048.58
marwex89 ........ 869.98
John ........ 868.39
morefood2001 ........ 868.04
WingedPanther ........ 761.06
Brandon W ........ 684.87
chili5 ........ 294.12
Steve.L ........ 216.18
dargueta ........ 192.86

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 81%

Ads