[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] A better way to do this?
Hello group,
I have a form page that contains some global information.
It is a form which does some processing. When adding a
'detail' form to it, I found myself needing the form to
either post form variables to itself or to another form.
The bounce tag comes pretty close but drops all CGI
variables, so I wrote this little script (which works
OK as long as there aren't too many CGI variables):
[if cgi postbutton]
[tag op=header interpolate=1]
[perl]
# Redirect to another page and keep CGI vars
$page="Content-type: text/html\n";
$page.="Location: [cgi postbutton].html";
my $n=0;
foreach my $k(keys %{$CGI}) {
$n=$n+1;
if (n==1) { $page.="?"; } else { $page.="&"; }
$page.="&".$k."=".$CGI->{$k};
}
$page.="\n\n";
return $page;
[/perl]
[/tag]
[/if]
The problem, of course, is that I have too many CGI
variables to pass to the header. Also, I'd like this to
be a POST operation rather than a GET, because I prefer
the users not to see all the mess that is passed in the
address bar of the browser.
The only other way I know is using a JavaScript to set the
form action just before submitting, but I'd rather not
depend on JS. I was wondering if any of you gurus out there
knows of a better way to do repost form data to another form?
Regards,
Marc Brevoort