Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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:

$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.


Comment on Re: Forwarding Post Data
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-08-29 04:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls