Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > CGI.pm form query sometime return null value

Reply
Thread Tools

CGI.pm form query sometime return null value

 
 
YesBalala
Guest
Posts: n/a
 
      02-10-2004
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.
 
Reply With Quote
 
 
 
 
YesBalala
Guest
Posts: n/a
 
      02-13-2004
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" <(E-Mail Removed)>
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
document.form.submit() does not work after sometime! Curious89 HTML 0 02-20-2010 01:52 PM
createImage sometime returns null and sometime returns non-null. vizlab Java 3 10-17-2007 11:21 AM
Why use "return (null);" instead of "return null;" ? Carl Java 21 08-24-2006 04:33 AM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
what value does lack of return or empty "return;" return Greenhorn C Programming 15 03-06-2005 08:19 PM



Advertisments