cortic
09-28-2002, 02:50 PM
I need to make sure there is no code that could mess up the page (or cgi), there is quite a few fields in the form, but I only need to check name and email fields (for validity- within reason & tags and things) the 'name' field will be displayed on the page and the email field will go into a cookie.
I checked a lot of tutorials and references and couldn't find much about this, there's a script I found, checks emails, uses:
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
Ok, I know what test does (but I didn't think you could test for more than one thing at a time), I cant figure out the info in the filter, could someone explain this or point me in the direction of a tutorial/reference that explains this?
I checked a lot of tutorials and references and couldn't find much about this, there's a script I found, checks emails, uses:
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
Ok, I know what test does (but I didn't think you could test for more than one thing at a time), I cant figure out the info in the filter, could someone explain this or point me in the direction of a tutorial/reference that explains this?