Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Forwarding Post Data

by thezip (Vicar)
on Nov 30, 2007 at 00:54 UTC ( #654021=note: print w/replies, xml ) Need Help??

in reply to Forwarding Post Data

Danikar, you could always save the CGI parameters into a standard CGI file via:


as documented in the CGI docs.

For each form submission, you'll need to generate a unique and retrievable key (which is the basis for the associated filename) so that you can identify which file belongs to that particular session. In your form, you'll need to include a hidden variable containing the value of this key so that it can be relayed through the form submission.

On the receiving side, create a FILEHANDLE to access the contents of your file. You can do this because you know the name of the file (via the hidden variable). There's a little housekeeping that happens afterwards (ie. deletion of the saved/expired CGI files, etc.).

It looks like this:

open(IFH, $CGI_filename) || die ... my $query = CGI->new(IFH);
An advantage to this method is that you can create many bogus form submissions to exercise the various features of your code. Be creative!

Update: Please be aware that there are some security considerations that go along with this. You need to take the appropriate precautions as you deem necessary.

Your wish is my commandline.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://654021]
and the grasshoppers chirp...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2018-03-17 11:33 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (224 votes). Check out past polls.