From: Martin Boese Date: 2008-09-30T06:46:10+09:00 Subject: Re: ruby cgi, add params and redirect You should use cookies (maybe with cgi session), or add the paramenters to the url, for example: puts cgi.header('status' => 'REDIRECT', 'location' => 'offsite_script.cgi?new_param=new_value') http://www.ruby-doc.org/core/classes/CGI/Session.html http://www.ruby-doc.org/core/classes/CGI/Cookie.html On Monday 29 September 2008 16:52:32 David Susco wrote: > I'm looking for a way to add parameters to a cgi object and then > redirect the user to another cgi script off site. > > ----- > require "cgi" > > cgi = CGI.new > > cgi.params['new_param'] = "new_value" > ... > > cgi.header("status" => "302", > "location" => "offsite_script.cgi") > ----- > > I can add parameters no problem as above, but the offsite script isn't > receiving the added parameters. Is this because the redirect is > happening before the parameters are being added? Is there another way to > do this? > > Thanks, > Dave