Re: mod_perl caching form data?

2003-05-31 Thread David Ressman
Thus spake Perrin Harkins ([EMAIL PROTECTED]):
 Let's not jump to conclusions.  We don't have a test case yet, and no
 one has seen David's code so he might have a simple global variables
 problem.

I suspect that the more likely explanation of this particular problem
is that I goofed up.  Anyway, the script is a thousand or so lines
long, so it doesn't make a whole lot of sense to post it here.  I'll go
through it all with a fine-toothed comb and try to see if I can make
the problem go away without having to call delete() to wipe out the
parameters.

If I'm able to do it, I'll certainly send something back to the list.



mod_perl caching form data?

2003-05-30 Thread David Ressman
[Sorry if an identical message comes through later.  I don't think the
list manager liked my address the first time I sent it through.]

Hi all,

I'm having a problem with mod_perl 1.2.7 that's baffling me completely,
and I've been searching and reading for days, but I still can't figure
it out.  My apologies if this comes up frequently.  I did try rather
lengthy searches through the mailing list archives.

Right now, I'm using mod_perl 1.2.7 compiled into an apache 1.3.27 
server running on a Solaris 9 (semi-current patches, though I can't
imagine that that's relevant) server.  I've written some fairly
straight-forward mod_perl scripts (using CGI.pm).  They take form  
data from the user, process it, and stick it in a database (through
DBI).

So far, so good.  Everything works pretty well...  Except that
something's caching previously entered form data and displaying it back
to me as the default values in those same forms.  As an example, this
form has a text field that asks for IP addresses, and the text input
will occasionally be filled out with the IP address of a system that
you had entered a few minutes ago.

Naturally, I suspected that my browser was the guilty party, even
though I had specified '-1d' as the expiration time in the CGI header()
command.  It turns out that this is not the case.  The forms will
occasionally be pre-filled out with IP addresses that other people have
given!  I even went so far as to set up a network sniffer to verify
that the server was indeed setting (in the HTML it sent to the client)
the value parameter of the text fields to an IP address that another
user had previously entered.

Needless to say, my script is *not* setting the default or value
parameters for these text fields.  As an uneducated guess, I'd say that
each httpd child-process is automatically filling out forms with data
that it itself has previously received, but that's only a guess, and it
still doesn't get me any closer to figuring out why it's happening.

Can anyone offer any assistance or point me somewhere that I could find
some documentation on what's happening?  I'm completely baffled.

Thanks!

David



Re: mod_perl caching form data?

2003-05-30 Thread David Ressman
Thus spake Cees Hek ([EMAIL PROTECTED]):
 input type=text name=ipaddress value=192.168.1.1
 
 If that value=192.168.1.1 is set in any of your form fields, then
 your script is the cuprit.  If your form fields don't have the
 value=192.168.1.1 set, or it is set to value=, then your browser is
 the culprit.

That's just the problem.  The value= parameter *is* filled out (and
it is being done at the server end as evidenced by the network sniffer.)
Unfortunately, my script is not doing it.  Here's what I have in the
script:

print IP Address: ,
  $cgi-textfield(-name='ipaddress', -size=20, -maxlength=20),
  $cgi-p;

But yet the form is filled out when I go to it with a web browser.

 Most modern browsers will offer to remember values you have entered
 into a form.
 On subsequent visits to the same URL, the values will be prefilled by
 the browser for you.

I was certain that that's what it was, but it just can't be.  I've even
used browsers on computers that have never been to the site before and
the data is still pre-filled out.
 
 mod_perl itself will never prefill form values for you.  It is
 completely up to your script (or the modules it uses) to munge the data
 coming through.

That's good to know.  Thanks very much.

 It is possible that you are creating your form fields with CGI.pm,
 which will use the currently POSTed parameters to prefill the form, or

This sounds like the most likely culprit, even though I haven't
explicitly turned anything on.  It's possible that I've done it
inadvertently.  I'll check it out.

Thanks again for your help.

David


mod_perl caching form data?

2003-05-30 Thread David Ressman
Hi all,

I'm having a problem with mod_perl 1.2.7 that's baffling me completely,
and I've been searching and reading for days, but I still can't figure
it out.  My apologies if this comes up frequently.  I did try rather
lengthy searches through the mailing list archives.

Right now, I'm using mod_perl 1.2.7 compiled into an apache 1.3.27
server running on a Solaris 9 (semi-current patches, though I can't
imagine that that's relevant) server.  I've written some fairly
straight-forward mod_perl scripts (using CGI.pm).  They take form
data from the user, process it, and stick it in a database (through
DBI).

So far, so good.  Everything works pretty well...  Except that
something's caching previously entered form data and displaying it back
to me as the default values in those same forms.  As an example, this
form has a text field that asks for IP addresses, and the text input
will occasionally be filled out with the IP address of a system that
you had entered a few minutes ago.

Naturally, I suspected that my browser was the guilty party, even
though I had specified '-1d' as the expiration time in the CGI header()
command.  It turns out that this is not the case.  The forms will
occasionally be pre-filled out with IP addresses that other people have
given!  I even went so far as to set up a network sniffer to verify
that the server was indeed setting (in the HTML it sent to the client)
the value parameter of the text fields to an IP address that another
user had previously entered.

Needless to say, my script is *not* setting the default or value
parameters for these text fields.  As an uneducated guess, I'd say that
each httpd child-process is automatically filling out forms with data
that it itself has previously received, but that's only a guess, and it
still doesn't get me any closer to figuring out why it's happening.

Can anyone offer any assistance or point me somewhere that I could find
some documentation on what's happening?  I'm completely baffled.

Thanks!

David