Checking user input
From: David (auto90059_at_hushmail.com)
Date: 09/09/03
- Next message: Damian Ibbotson: "Re: Replace string starting from the 2nd occurrence using sed?"
- Previous message: Juergen Heck: "Re: KSH question"
- Next in thread: Ed Morton: "Re: Checking user input"
- Reply: Ed Morton: "Re: Checking user input"
- Reply: laura fairhead: "Re: Checking user input"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 9 Sep 2003 20:56:26 +1000
I need to grab between 1 and 4 tags (the exact number will vary) from user
input within a script and then assign the tags to variables for later use in
an sql select .. from .. where .. in("$tag1", "$tag2") statement. The order
doesn't matter, but it's important that valid tags are entered - they each
must have the value "O" or "W" or "WT" or "VT". Is there a reasonably
robust way to do this?
Still on user input, I want ours to enter a date in the format YYYYMMDD. We
could potentially use a / or another char as a delimiter and strip it out
after if this makes things easier. Is it possible to check that the MM
field is between 1 and 12, or that the DD field is between 1 and 31? Can we
make sure that the string that's been entered is exactly 8 numeric
characters and otherwise conforms to our format?
Thanks,
David
- Next message: Damian Ibbotson: "Re: Replace string starting from the 2nd occurrence using sed?"
- Previous message: Juergen Heck: "Re: KSH question"
- Next in thread: Ed Morton: "Re: Checking user input"
- Reply: Ed Morton: "Re: Checking user input"
- Reply: laura fairhead: "Re: Checking user input"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|