felixtkatt
Programmer
I'm attempting to create a (very) weak email validation bit using a simple CFIF and a few string functions. Here's the code:
emailFrom contains the email address from a form field on the previous page. The real sticker is that FindNoCase is returning 0 on every call. I tried having the function search for the "at" symbol (@) instead, and it still came up 0. Are there characters that FindNoCase can't find? Is my sytax wrong somewhere? Someone please help! FTK
Code:
<cfif (FindNoCase(emailFrom, ".com") IS NOT 0) OR
(FindNoCase(emailFrom, ".net") IS NOT 0) OR
(FindNoCase(emailFrom, ".org") IS NOT 0) OR
(FindNoCase(emailFrom, ".edu") IS NOT 0) OR
(FindNoCase(emailFrom, ".gov") IS NOT 0)>
...Do good email stuff...
<cfelse>
...Tell them their dumb for typing a bogus email address...
</cfif>
emailFrom contains the email address from a form field on the previous page. The real sticker is that FindNoCase is returning 0 on every call. I tried having the function search for the "at" symbol (@) instead, and it still came up 0. Are there characters that FindNoCase can't find? Is my sytax wrong somewhere? Someone please help! FTK