How to redirect from one CGI to another

后端 未结 2 1243
隐瞒了意图╮
隐瞒了意图╮ 2021-01-27 17:14

I am sending data from A.cgi to B.cgi. B.cgi updates the data in the database and is supposed to redirect back to A.cgi, at w

相关标签:
2条回答
  • 2021-01-27 17:38

    Location: is a header and headers must come before all ordinary output, that's probably your problem. But doing this manually is unneccessarly complicated anyways, you would be better of using the redirect function of CGI.pm

    0 讨论(0)
  • 2021-01-27 17:43

    Use CGI's redirect method:

    my $url = "http://Travel/cgi-bin/A.cgi";
    my $q = CGI->new;
    print $q->redirect($url);
    
    0 讨论(0)
提交回复
热议问题