controlling user input

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 18426
interpreted = N
texte = I have to verify user input for special fields where are only the following characters are allowed: numbers (ascii 48-57) uppercase chars (ascii 65-90) lowercase chars (ascii 97-122) Therefore I step through the given word to find out if each character is within the allowed range. Since WebCat has no command to do a quick ascii comparison, I first tried something which basically looks like this: [GetChars start=[math]loopcounter[/math] &end=[math]loopcounter[/math]] [UserInput] [/GetChars] where start and end values come from a [loop] command and are incremented at each run. So far, so good - but I had to add a bunch of showif's to compare the chars and finally ended up in a mess of code for a simple thing like three ascii ranges.I decided to loop like above, but instead the showif's I have a database with allowed values and do a lookup for each character of the given word. If I get a notfound, then an error message is displayed.That works fine (and is not used very often in this site), lookup is fast, but I wonder if subsequent lookups for up to 30 user-entered characters are the state of the art in WebCat-programming ;-) Any other idea? Peter__________________________________________ Peter Ostry - po@ostry.com - www.ostry.com Ostry & Partner - Ostry Internet Solutions Auhofstrasse 29 A-1130 Vienna Austria fon ++43-1-8777454 fax ++43-1-8777454-21 Associated Messages, from the most recent to the oldest:

    
  1. Re: controlling user input (Kenneth Grome 1998)
  2. controlling user input (Peter Ostry 1998)
I have to verify user input for special fields where are only the following characters are allowed: numbers (ascii 48-57) uppercase chars (ascii 65-90) lowercase chars (ascii 97-122) Therefore I step through the given word to find out if each character is within the allowed range. Since WebCat has no command to do a quick ascii comparison, I first tried something which basically looks like this: [GetChars start=[math]loopcounter[/math] &end=[math]loopcounter[/math]] [UserInput] [/GetChars] where start and end values come from a [loop] command and are incremented at each run. So far, so good - but I had to add a bunch of showif's to compare the chars and finally ended up in a mess of code for a simple thing like three ascii ranges.I decided to loop like above, but instead the showif's I have a database with allowed values and do a lookup for each character of the given word. If I get a notfound, then an error message is displayed.That works fine (and is not used very often in this site), lookup is fast, but I wonder if subsequent lookups for up to 30 user-entered characters are the state of the art in WebCat-programming ;-) Any other idea? Peter__________________________________________ Peter Ostry - po@ostry.com - www.ostry.com Ostry & Partner - Ostry Internet Solutions Auhofstrasse 29 A-1130 Vienna Austria fon ++43-1-8777454 fax ++43-1-8777454-21 Peter Ostry

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

[WebDNA] Problem with Cookies in IE and Safari (2009) Redirect to anchor (2001) RE:It just Does't add up!!! (1997) WebCatalog 4.0.2rc1 and rc2 crash WebSTAR on quit (2001) Date Formats (1997) Help! WebCat install problems... (2000) WebCat2b13MacPlugIn - more [date] problems (1997) Example Search Form (1997) WebCat2: Items xx to xx shown, etc. (1997) Security (1998) displaying New products (using [date]) (1997) WCS Newbie question (1997) WebCatalog-NT?'s (1996) WebCat2: Found Items syntax, etc. (1997) about this server and links to who (1997) WebCatalog memory error. (1998) A [Loop][APPEND][URL] ... [/URL][/APPEND]/Loop] Question (2000) [Shell]ps -A[/Shell] Linux Webcat Q (2000) this works sometimes and sometimes not (1997) vars (2000)