I want to send parameters to a page via a redirect using a ruby CGI script; however, I want to do it as a post if possible (ie. not pass a parameter string in the URL). I have it working using a parameter string in the URL using the code below开发者_运维知识库.
def redirect( new_page )
print "Location:#{new_page}\n\n"
end
redirect("aPage.html?name=bla&something=else");
As far as I have been able to research, I have not found a way to do this. One way around this without doing an html redirect is to open the html file in your CGI script and print it as you would when your CGI is generating the html. The only catch here is that you will have the URL to your CGI script in the address bar, it may be possible to do a redirect using .htaccess (though I can't say for sure if that will work).
Hope this helps! :-D
精彩评论