Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Forwarding Post Data

by thezip (Vicar)
on Nov 30, 2007 at 00:54 UTC ( [id://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:

$query->save(\*FILEHANDLE);

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2025-02-15 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found