View Single Post
Old 11-06-2004, 12:05 PM  
V_RocKs
Damn Right I Kiss Ass!
 
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,428
Quote:
Originally posted by Lace
so you're lace tongue....interesting.
Right, and you shouldn't use javascript to clean up form values. If I turn it off or post it from my own server, you are kinda screwed.

PHP Code:
function emailCheck (emailStr) {
var 
emailPat=/^(.+)@(.+)$/
var 
specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" specialChars "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var 
atom=validChars '+'
var word="(" atom "|" quotedUser ")"
var userPat=new RegExp("^" word "(\\." word ")*$")
var 
domainPat=new RegExp("^" atom "(\\." atom +")*$")
var 
matchArray=emailStr.match(emailPat)
if (
matchArrayhahahahanull) {
    
alert("Email address seems incorrect (check @ and .'s)")
    return 
false

V_RocKs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote