--- David Gilden <[EMAIL PROTECTED]> wrote:

> my $mt = param('message type');
> 
> if (length($mt) == 0) {
> print redirect("/pages/error.html");
> exit;
> }
> 
> This should only redirect it someone has not made a 'selection' ....
> what am I missing?

Unless you send bad HTML or someone's messing with their submit data,
it's very unlikely that someone won't have made a selection.  In that
case, you want to check the "truth" of the selection value, not the
length.  As previously noted, the length of "0" is 1, but you really
don't care about that.  I would leave the value as 0 or set it to the
empty string and write the condition like this:

  if ($mt) { ... }

Cheers,
Ovid

-- 
If this message is a response to a question on a mailing list, please send
follow up questions to the list.

Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to