classic asp2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • splendid9
    New Member
    • Mar 2008
    • 56

    classic asp2

    If (standard_email _address <> "") Then
    if(IsValidEmail ("standard_emai l_address") = false) Then
    Response.Redire ct("../../ChecksError.asp ")
    end if
    end if

    i am getting error page even if i enter valid email id...i have included email validation method in include file

    email validation:


    Function IsValidEmail(sE mail)
    dim bValidated, vToEmail
    ' Innocent until proven guilty
    bValidated = True

    vToEmail = sEmail
    if instr(vToEmail , "@") < 2 then
    bValidated= false
    end if

    if instr(vToEmail , "@") = len(vToEmail) then
    bValidated= false
    end if

    IsvalidEmail = bValidated
    end Function
    could any one pls reply me ASAP
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi there,

    You've accidentally put quotation marks around the variable standard_email_ address when you've called the IsValidEmail function which has passed standard_email_ address as a string rather than a variable.

    If you change the line to:
    Code:
     
    if (IsValidEmail(standard_email_address) = false) Then
    it should work fine.

    Hope this helps,

    Dr B

    Comment

    Working...