Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

IE wont post after initial request

by BigJoe (Curate)
on Jun 12, 2002 at 15:31 UTC ( [id://173869]=perlquestion: print w/replies, xml ) Need Help??

BigJoe has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know a work around for Apache/Mod_perl/IE to force IE into sending the form data after the first post?

KeepAlive is on in Apache and I need it to be on for an authentication piece. I have a script that looks like :
#!/usr/bin/perl -wT use strict; use CGI; my $q = new CGI; print $q->header; print <<EODUMP; <html><body> <form method=post> <input type=text name=foo><br> <input type=submit value=Submit> </form> EODUMP if(defined($q->param('foo'))){ print $q->param('foo'); } print "</body></html>";

my revelant httpd.conf lines are:
SetHandler perl-script PerlModule Apache::DBI PerlHandler Apache::Registry #PerlHandler Apache::PerlRun PerlSendHeader Off PerlSetupEnv On Options +ExecCGI


--BigJoe

Learn patience, you must.
Young PerlMonk, craves Not these things.
Use the source Luke.

Replies are listed 'Best First'.
Re: IE wont post after initial request
by dree (Monsignor) on Jun 12, 2002 at 17:56 UTC
    IE does not like cache pragmas very much... more information here and here

    Instead you can approach in this way:

    1) instead of a static html form, generate it with Perl
    2) in place of the simple name of your script (to put in the "action" attribute of the form) put the name followed by a ? and a random number.

    So, IE will think that you're calling a different script.

    For example:
    my $rand_num=rand time; $rand_num*=10000; my $cgi='mycgi.pl?'.$rand_num;


    Kudos to larsen for showing me this trick
      I gave this a try and it didn't fix the issue.

      Unless anyone else another suggestion it looks like I am going to start working on a complex alternate solution (dealing with multiple Apache Servers on the same system with different configs, etc.)

      Thanks a ton to everyone who submitted their suggestions. Maybe the person with the answer to this will see it today?

      --BigJoe

      Learn patience, you must.
      Young PerlMonk, craves Not these things.
      Use the source Luke.
Re: IE wont post after initial request
by vagnerr (Prior) on Jun 12, 2002 at 15:45 UTC
    It might be that IE is chaching the data and doesnt think it needs to do another post. IE likes to be helpfull like that. Try adding the follwing into you HTML output in the <HEAD> section
    <meta http-equiv="Pragma" content="no-cache">

    Update: Thanks to Zakb, I was confirming the existance of the Hyphen and stuff :-) (++)

    ---If it doesn't fit use a bigger hammer

      That should be:

      <meta http-equiv="Pragma" content="no-cache">

      Chances are, for this to work properly in all browsers, you'll also need:

      <meta http-equiv="Cache-Control" content="no-cache"> <meta http-equiv="Expires" content="0">

      Note that these tags will most definitely not work unless they are between your <head> and </head> tags. See here for some useful information.

        I tried this and it still doesn't work after the first post
        #!/usr/bin/perl -wT use strict; use CGI; my $q = new CGI; print $q->header; print <<EODUMP; <html> <head> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta http-equiv="Expires" content="0"> </head> <body> <form method=post> <input type=text name=foo><br> <input type=submit value=Submit> </form> EODUMP #if(defined($q->param('foo'))){ print $q->param('foo'); #} print "</body></html>";


        --BigJoe

        Learn patience, you must.
        Young PerlMonk, craves Not these things.
        Use the source Luke.
Re: IE wont post after initial request
by projekt21 (Friar) on Jun 12, 2002 at 15:53 UTC
      I probably should have given some history about this. I noticed this issue with some scripts that do have the action piece in it. I just wrote a quick test script to see if changes to Apache would help. And being that I am a PERL programmer I felt that typing in act.. etc was too much. But I have added it just to make sure.

      Thanks

      --BigJoe

      Learn patience, you must.
      Young PerlMonk, craves Not these things.
      Use the source Luke.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://173869]
Approved by George_Sherston
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found