Subject: Re: Complex CGI question (possibly javascript)
>"Can I take a CGI-Post of form data to my server, record the
>posted data, and then send back a header such that the browser
>re-posts the data to another server?"
yes.. depending on how much data you have.
the trick is to convert the form data sent by the POST query to server A
into a URL extension for a GET query on server B. in general, that's
simple:
#!/usr/local/bin/perl
#
# this script lives on server A.
# it gets called from a form, using the POST method.
#
$URL = 'http://serverB.foo.com/cgi-bin/script2.pl';
read (STDIN, $input, $ENV{'CONTENT_LENGTH'});
print "Location: $URL?$input\n\n";
---- EOF ----
#!/usr/local/bin/perl
#
# this script lives on server B.
# it gets called through a link, using the GET method.
#
$input = $ENV{'QUERY_STRING'};
print <<__done;
Content-type: text/html
THE INPUT TO SERVER A WAS:
$input
__done
---- EOF ----
the caveat is that there's an upper limit to the length of data which
can be tacked onto a URL. i don't recall the number off the top of my
head, but i think it's somewhere around 1K.
if you're just asking the user to log in on one machine, and want to
pass the approved identity to the next, that should be no problem. if
you want to pass a whole truckload of data from the first machine to the
second, you'll need to look at ways to compress the data.
that's your basic state-preserving bankshot from one server to another,
though.