[ic] A better way to do this?

Kevin Walsh interchange-users@icdevgroup.org
Tue Nov 5 09:16:01 2002


marc.brevoort [marc.brevoort@armazemdedados.com] wrote:
> 
> 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?
> 
CGI variables will automatically be saved to the user's session and may
be used on any other page as [value whatever].  This is unless they are
overridden by new CGI values.  For this reason simple link will do
exactly what you need - unless I misunderstood your question. :-)

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/