CGI.pm form query sometime return null value

Discussion in 'Perl' started by YesBalala, Feb 10, 2004.

  1. YesBalala

    YesBalala Guest

    I am using CGI.pm, and getting the parameters similiar to the
    followings,

    use CGI::Carp qw(fatalsToBrowser);
    use CGI qw:)all);
    :
    my $task = param('task');
    my $username= param('username');

    Then I have a debug log as the next line. From the debug log, look
    like there are times where task and username return nothing, although
    it's been entered in the form.

    I have a debug script in java, and when I point the form to submit to
    that debug script instead of this perl script, it works all the time.
    Seems like the problem comes in the perl side.

    Does anyone got an idea about this?

    Bosco.

    Bosco

    --
    Due to heavy spamming, I was forced to use an invalid reply address.
    Do NOT reply to this posting via email directly.
    YesBalala, Feb 10, 2004
    #1
    1. Advertising

  2. YesBalala

    YesBalala Guest

    Your script will only ensure it's not empty, but I can ensure that the
    value is there. I have a java script to check for empty form before
    submitting, and when empty parameter occur, hit the refresh icon to
    repost the data and now the script can get it. So, the entered data is
    there, being kept in the client's browser somewhere, just it does not
    pass thru to the script for the first time. Refresh (means repost)
    will work (so user don't need to re-enter). Anyone got further idea on
    this?

    Bosco.

    --
    On Thu, 12 Feb 2004 08:35:14 -0500, "Tulan W. Hu" <>
    wrote:

    >It never happened to me and it must be in your script.
    >Try:
    >my $query = new CGI;
    >if (param()) {
    > ensure_entered($query->param('username'));
    >} else {
    > #display your html form here
    >}
    >sub ensure_entered {
    ># make sure it is not empty
    >}
    >



    Bosco

    --
    Due to heavy spamming, I was forced to use an invalid reply address.
    Do NOT reply to this posting via email directly.
    YesBalala, Feb 13, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SnVsaWE=?=
    Replies:
    4
    Views:
    749
    =?Utf-8?B?SnVsaWE=?=
    Nov 7, 2004
  2. Eric
    Replies:
    2
    Views:
    348
    Jason Kester
    Oct 25, 2005
  3. vizlab
    Replies:
    3
    Views:
    4,173
    Michael Bar-Sinai
    Oct 17, 2007
  4. Carl
    Replies:
    21
    Views:
    974
    Patricia Shanahan
    Aug 24, 2006
  5. Curious89
    Replies:
    0
    Views:
    908
    Curious89
    Feb 20, 2010
Loading...

Share This Page