forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Basic Email Validation for CGI

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code
View previous topic :: View next topic  
Author Message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Jul 03, 2002 6:04 am    Post subject: Basic Email Validation for CGI Reply with quote

%%Email contains the email address being submitted to your form. The label "BadEmail" would be where you send the script to print whatever html back to the user to let them know that the email they are trying to submit is not valid.

This is only a basic email validation routine and it only checks to insure that the format of the email address being submitted is correct. If you want, from here you could go as far as adding DNS Lookup to see if the domain for the email address is valid.

Code:
  If @null(%%Email)
    Goto BadEmail
  End
  Option DecimalSep,.
  Option Fieldsep,@chr(64)
  Parse "%%PreAddy;%%SvrAddy",%%Email
  %%SvrDomain = @name(%%SvrAddy)
  %%SvrExtention = @ext(%%SvrAddy)
  If @null(%%PreAddy)
    Goto BadEmail
  End
  If @null(%%SvrDomain)
    Goto BadEmail
  End
  If @null(%%SvrExtention)
    Goto BadEmail
  End
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Jul 03, 2002 6:15 am    Post subject: Reply with quote

You can also stack these:
Code:

if @null(%%PreAddy)
   goto BadEmail
end
if @null(%%SvrDomain)
   goto BadEmail
end
if @null(%%SvrExtention)
   goto BadEmail
end

Into one IF/END like this:
Code:

if @null(%%PreAddy)@null(%%SvrDomain)@null(%%SvrExtention)
   goto BadEmail
end


Cheers, Mac

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group