Verify E-Mail Address

From: Date: Wed, 12 Sep 2001 19:16:29 +0000
Subject: Verify E-Mail Address
Groups: php.general 
Request: Send a blank email to php-general+get-67071@lists.php.net to get a copy of this message
Hello, I have a page which is a form for people to fill in. There is one input line where the user enters in an e-mail address. Currently the page is using java to verify that e-mail address. It looks like the java code is only checking for an "@" side, but I want it to also check for a "." and the end of the domain type. Somebody else wrote this code for me, and I don't know anything about java. Could somebody show me what I need to do to change this java code to PHP? If that is even possible? And, to do the additional verify that I would like to do on the e-mail address. Here is the code: function validate(){ form = document.subscribe; if ( form.email.value == ""){ alert("Please enter your email address in the \"Email Address\" and \"Verify Email Address\" boxes"); form.email.focus(); return false; } else { if ( form.email.value != form.vemail.value ){ alert("Please verify you have entered the correct email address in the \"Email Address\" and \"Verify Email Address\" boxes"); form.email.focus(); return false; } } if( form.email.length != 0) { txt = form.email.value; if (txt.indexOf("@")<3) { alert("This email address seems wrong. Please check the prefix and \"@\" sign."); form.email.focus(); return false; } } if( form.vemail.length != 0) { txt = form.vemail.value; if (txt.indexOf("@")<3) { alert("This email address seems wrong. Please check the prefix and \"@\" sign."); form.vemail.focus(); return false; } } } Thanks, Jeff -- Jeff Grossman (jeff@stikman.com)

« previous php.general (#67071) next »