--- Daniel Falkenberg <[EMAIL PROTECTED]> wrote:
> The above is my HTML.  Therefore if the user selects 20 min I want 20 min to
> be passed onto the next sub in my script.  Would I go about it like this...
> 
> my $selection = param('time_track_minutes');

Yup.  That's pretty much how you would do it.  I would add at least a little bit of 
validation,
though, to ensure that you are at least getting numbers.

use CGI qw/:standard/;

my $_selection = param('time_track_minutes') || '';
my ( $selection ) = ( $_selection =~ /^(\d{1,2})$/ );

That will ensure that the $selection variable will have one or two digits.  If it 
contains
anything *other* than digits, $selection will be undefined.  Then, when you pass it to 
your sub,
you check to see if it's defined.  If not, someone may have tried to alter the form and
deliberately pass bad data.

Cheers,
Curtis Poe

=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to