sshukla has asked for the wisdom of the Perl Monks concerning the following question:

Is there any way to pass and get parameters while redirecting? more specifically my module1 is using $q->redirect(-url => 'my url/module2.cgi', -cookie => "$cookie"); in the module2.cgi I want to get Product_id parameter. Can you please show me a way out? Thanks Saumil

Replies are listed 'Best First'.
Re: HTTP redirection and parameter access
by redsquirrel (Hermit) on Feb 26, 2002 at 18:36 UTC
    Maybe I'm missing something, but wouldn't you just pass the parameter in the URL?
    $q->redirect( -url => 'url/module2.cgi?Product_id=1234', -cookie => $cookie, );
    --Dave
      I tried $q->redirect( -url => 'my_url/module2.cgi', -cookie => $cookie, -name => 'Product_id', -value => "$product_id" ); and was getting error. Thanks Saumil
Re: HTTP redirection and parameter access
by justinNEE (Monk) on Feb 26, 2002 at 20:13 UTC
    redsquirrel is saying to put the parameters in the URL, Saumil. Or, you can let the html redirect for you(or whatever Script) with all your values in a form:
    print<<"this_junk"; <HTML> <META HTTP-EQUIV="REFRESH" CONTENT="0;URL=http://www.whatever.com"> <FORM METHOD="POST"> <INPUT TYPE=HIDDEN NAME="myName1" VALUE="myValue1"> <INPUT TYPE=HIDDEN NAME="myName2" VALUE="myValue2"> </FORM> </HTML> this_junk