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 followingcharacters 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 iswithin the allowed range. Since WebCat has no command to do a quick asciicomparison, 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 incrementedat each run. So far, so good - but I had to add a bunch of showif's tocompare the chars and finally ended up in a mess of code for a simple thinglike three ascii ranges.I decided to loop like above, but instead the showif's I have a databasewith 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 arethe state of the art in WebCat-programming ;-)Any other idea?Peter__________________________________________Peter Ostry - po@ostry.com - www.ostry.comOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29   A-1130 Vienna    Austriafon ++43-1-8777454   fax ++43-1-8777454-21
Associated Messages, from the most recent to the oldest:
I have to verify user input for special fields where are only the followingcharacters 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 iswithin the allowed range. Since WebCat has no command to do a quick asciicomparison, 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 incrementedat each run. So far, so good - but I had to add a bunch of showif's tocompare the chars and finally ended up in a mess of code for a simple thinglike three ascii ranges.I decided to loop like above, but instead the showif's I have a databasewith 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 arethe state of the art in WebCat-programming ;-)Any other idea?Peter__________________________________________Peter Ostry - po@ostry.com - www.ostry.comOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29   A-1130 Vienna    Austriafon ++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:
 
using WebCat for Associate Programs? (1998)
 
using showpage and showcart commands (1996)
 
[WebDNA] bulk e-mail (2011)
 
Error Log.db --however (1997)
 
Database Updates (1997)
 
[TaxableTotal] - not working with AOL and IE (1997)
 
apostrophe in search item (1997)
 
OK, here goes... (1997)
 
I'm new be kind (1997)
 
Calculating Shipping (1997)
 
[WebDNA] Crashing again (2008)
 
4.0 send email ticks. .  (2000)
 
ConverChars (1999)
 
Search inside Include (1998)
 
PCS Customer submissions ? (1997)
 
Date search bug (1998)
 
[random] only for 1-100??? (1997)
 
Search/sort in URL   Was: GuestBook example (1997)
 
locking variables? (2000)
 
Separate SSL Server (1997)