There are some good scripts (JavaScripts) to test it, but it's good to test
on ACTION page too (as some people may want to write a form to include
records in your DB.
A simple check in ASP is
if InStrRev(email, "@") = 0 then ' NOT if InStrRev(email, "@") 0 then (
the sign "=" )
... fail
end if
You can even test if "@" is not the last character...
If right(email,1) = "@"
... fail
end if
Elildo Mancebo Reis
elildo@a...
www.aspecto.net
-----Mensagem original-----
De: Andy [mailto:andy@t...]
Enviada em: quarta-feira, 19 de março de 2003 11:38
Para: ASP Web HowTo
Assunto: [asp_web_howto] Re: RES: Checking User
Hello ,
That works!!! Thanks....:-)
How can I check if the user has enter a valid email address with the "@"
sign ?
Thanks
Andy
----- Original Message -----
From: "Elildo Mancebo Reis" <lists@a...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Wednesday, March 19, 2003 10:28 PM
Subject: [asp_web_howto] RES: Checking User
> Just use...
> if Username = "" then
> ...
> end if
>
> It would be good...
> if len(trim(username)) = 0 then
>
> Elildo Mancebo Reis
> elildo@a...
> www.aspecto.net
>
> -----Mensagem original-----
> De: Andy [mailto:andy@t...]
> Enviada em: quarta-feira, 19 de março de 2003 11:20
> Para: ASP Web HowTo
> Assunto: [asp_web_howto] Checking User
>
>
> Hello,
>
> I have an asp page which allow user to create an account.When the form is
> submited, I perform some checking on the username field, if the username
> field is empty , it will return an error message but it seems not be
> working.Below is my code :
>
> 'Save entered username and password
> Username = Request.Form("txtUsername")
> Password = Request.Form("txtPassword")
> Fullname = Request.Form("txtFullname")
> Email = Request.Form("txtEmail")
>
> If Username = " " Then
> Response.Redirect "signup.asp?loginname=failed"
> End If
>
>
> Hope someone might guide me through.
>
>
> Thanks.
>
>
> Andy
>
>
> %%email.unsub%%
>
>
>
>
%%email.unsub%%