0 Members and 1 Guest are viewing this topic.
Not much, but a simple script to verify whether the provided email address is valid or not. This script can be useful when you're storing emails of your players, for whatever purpose. You can point out the invalid emails and prompt the user to enter a valid one. Valid emailsperson@domain.comperson@sub.domain.comInvalid emailsall the random idiotic ones.Source CodeCode: [Select]function verifyEmail( email ) { if ( email.find( "@" ) == null && email.find( "." ) == null ) return 0; else { local domain, sep = split( email, "@" ); if ( sep.len() == 2 ) { domain = split( sep[1], "." ); if ( domain.len() > 1 ) { local length = domain.len() == 2 ? domain[1].len() : domain[2].len(); if ( length > 1 ) return 1; else return 0; } else return 0; } else return 0; }}Example
function verifyEmail( email ) { if ( email.find( "@" ) == null && email.find( "." ) == null ) return 0; else { local domain, sep = split( email, "@" ); if ( sep.len() == 2 ) { domain = split( sep[1], "." ); if ( domain.len() > 1 ) { local length = domain.len() == 2 ? domain[1].len() : domain[2].len(); if ( length > 1 ) return 1; else return 0; } else return 0; } else return 0; }}