<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>Spam Filter ISP Forums : Form Validation in "Register.asp"</title>
  <link>https://www.logsat.com/spamfilter/forums/</link>
  <description><![CDATA[This is an XML content feed of; Spam Filter ISP Forums : Spam Filter ISP Support : Form Validation in "Register.asp"]]></description>
  <pubDate>Fri, 04 Sep 2026 22:01:13 +0000</pubDate>
  <lastBuildDate>Fri, 13 Jun 2003 10:33:00 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 11.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://www.logsat.com/spamfilter/forums/RSS_post_feed.asp?TID=943</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Spam Filter ISP Forums]]></title>
   <url>https://www.logsat.com/spamfilter/forums/forum_images/web_wiz_forums.png</url>
   <link>https://www.logsat.com/spamfilter/forums/</link>
  </image>
  <item>
   <title><![CDATA[Form Validation in "Register.asp" : We have had quite a few users...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=943&amp;PID=943&amp;title=form-validation-in-registerasp#943</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=22">Desperado</a><br /><strong>Subject:</strong> 943<br /><strong>Posted:</strong> 13 June 2003 at 10:33am<br /><br /><P>We have had quite a few users sign up using their name instead of their email address even tho our registrationpage is clearly spelled out in red that it must be their actual email address.</P><P>I added&nbsp;the following code just after the "Form" code and added the validation function at the very end in the "register.asp" <A HREF="http://file:" CLASS="ASPForums" TITLE="WARNING: URL created by poster. ">http://file:</A></P><P>=======================================</P><P>&lt;%<BR>&nbsp;&nbsp;Response.End<BR>&nbsp;End If</P><P>&nbsp;'Validate the email format<BR>&nbsp;If chkEmail(Email) = 1 Then<BR>%&gt;<BR>&lt;div align="left"&gt;</P><P>&lt;table border="0" cellpadding="0" cellspacing="0"&gt;<BR>&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td align="left"&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td align="left" width="10"&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td align="left"&gt;&lt;/td&gt;<BR>&nbsp; &lt;/tr&gt;<BR>&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td align="left"&gt;&lt;img src="<A HREF="undefined" CLASS="ASPForums" TITLE="WARNING: URL created by poster. "></td'><A HREF="http://www.mags.net/images/logo/logo_center.gif" CLASS="ASPForums" TITLE="WARNING: URL created by poster. ">http://www.mags.net/images/logo/logo_center.gif</A>"&gt;&lt;/td</A>&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td align="left" width="10"&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td align="left"&gt;&lt;font color="#FF0000"&gt;&lt;big&gt;&lt;big&gt;&lt;strong&gt;Spam Filter Registration Error&lt;/strong&gt;&lt;/big&gt;&lt;/big&gt;&lt;/font&gt;&lt;/td&gt;<BR>&nbsp; &lt;/tr&gt;<BR>&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td align="left"&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td align="left" width="10"&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td align="left"&gt;&lt;/td&gt;<BR>&nbsp; &lt;/tr&gt;<BR>&lt;/table&gt;<BR>&lt;/div&gt;<BR>&lt;p&gt;&lt;font face="Arial" color="#FF0000"&gt;&lt;strong&gt;You did not enter a valid email address!&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;</P><P>&lt;p&gt;&lt;font face="Arial" color="#FF0000"&gt;&lt;strong&gt;Please &lt;a href="/register.asp"&gt;Try Again&lt;/a&gt; or<BR>contact &lt;a href="<A HREF="undefined" CLASS="ASPForums" TITLE="WARNING: URL created by poster. ">support@mags.net</a'><A HREF="http://mailto:support@mags.net" CLASS="ASPForums" TITLE="WARNING: URL created by poster. ">http://mailto:support@mags.net</A>"&gt;support@mags.net&lt;/a</A>&gt; for help.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt;</P><P>&lt;%</P><P>===================</P><P>&lt;%<BR>'&nbsp;Added Email format chacking 6-13-2002&nbsp; DAS</P><P>function chkEmail(theAddress)<BR>&nbsp;&nbsp; ' checks for a vaild email<BR>&nbsp;&nbsp; ' returns 1 for invalid addresses<BR>&nbsp;&nbsp; ' returns 0 for valid addresses<BR>&nbsp;&nbsp; dim atCnt<BR>&nbsp;&nbsp; chkEmail = 0</P><P>&nbsp;&nbsp; ' chk length<BR>&nbsp;&nbsp; if len(theAddress) &lt; 5&nbsp; then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' <A HREF="mailto:a@b.c" CLASS="ASPForums" TITLE="WARNING: URL created by poster. ">a@b.c</A> should be the shortest an<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' address could be<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chkEmail = 1<BR>&nbsp;<BR>&nbsp;&nbsp; ' chk format<BR>&nbsp;&nbsp; ' has at least one "@"<BR>&nbsp;&nbsp; elseif instr(theAddress,"@") = 0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chkEmail = 1<BR>&nbsp;<BR>&nbsp;&nbsp; ' has at least one "."<BR>&nbsp;&nbsp; elseif instr(theAddress,".") = 0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chkEmail = 1<BR>&nbsp;<BR>&nbsp;&nbsp; ' has no more than 3 chars after last "."<BR>&nbsp;&nbsp; elseif len(theAddress) - instrrev(theAddress,".") &gt; 3 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chkEmail = 1<BR>&nbsp;<BR>&nbsp;&nbsp; ' has no "_" after the "@"<BR>&nbsp;&nbsp; elseif instr(theAddress,"_") &lt;&gt; 0 and _<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; instrrev(theAddress,"_") &gt; instrrev(theAddress,"@")&nbsp; then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chkEmail = 1</P><P>&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' has only one "@"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; atCnt = 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i = 1 to len(theAddress)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if&nbsp; mid(theAddress,i,1) = "@" then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; atCnt = atCnt + 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; next<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if atCnt &gt; 1 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chkEmail = 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end if</P><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' chk each char for validity<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i = 1 to len(theAddress)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if&nbsp; not isnumeric(mid(theAddress,i,1)) and _<BR>&nbsp;&nbsp;(lcase(mid(theAddress,i,1)) &lt; "a" or _<BR>&nbsp;&nbsp;lcase(mid(theAddress,i,1)) &gt; "z") and _<BR>&nbsp;&nbsp;mid(theAddress,i,1) &lt;&gt; "_" and _<BR>&nbsp;&nbsp;mid(theAddress,i,1) &lt;&gt; "." and _<BR>&nbsp;&nbsp;mid(theAddress,i,1) &lt;&gt; "@" and _<BR>&nbsp;&nbsp;mid(theAddress,i,1) &lt;&gt; "-" then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chkEmail = 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; next<BR>&nbsp; end if<BR>end function<BR>%&gt;<BR></P><P>I hope this will slow down some of the "I never got my registration password" phone calls.</P><P>Dan</P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Fri, 13 Jun 2003 10:33:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=943&amp;PID=943&amp;title=form-validation-in-registerasp#943</guid>
  </item> 
 </channel>
</rss>