如何在 CGI 脚本中调用另一个 Perl CGI 脚本?

发布于 2024-08-12 05:52:08 字数 132 浏览 2 评论 0原文

我有一个 Perl CGI 脚本,它创建一个登录屏幕,即用户名和密码。

我希望在成功登录后,将用户重定向到应用程序中的下一个操作(另一个 Perl CGI 脚本)。

重定向 CGI 脚本或 HTML 页面的命令是什么?

I have a Perl CGI script that creates a login screen, i.e. user name and password.

I want, after successful login, the user to be redirected to the next action within the application (another Perl CGI script).

What is the command to redirect one CGI script or to an HTML page?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

﹎☆浅夏丿初晴 2024-08-19 05:52:08

在 HTTP 术语中,您应该让程序输出 302 或 303 状态代码位置标头

如果您使用 CGI.pm 那么您可以使用重定向方法来实现此目的。

In HTTP terms you should have your program output a 302 or 303 status code and a Location header.

If you are using CGI.pm then you can use the redirect method to achieve this.

蓝戈者 2024-08-19 05:52:08

使用 CGI 作为 David Dorward 提到。

use CGI;

if (redirect_needed) {
    # If redirect is desired, don't print headers...
    print CGI->redirect("http://some.other.url/");
    exit; 
}

# If no redirect is desired...
print CGI->header();
# etc...

An example using CGI as David Dorward mentions.

use CGI;

if (redirect_needed) {
    # If redirect is desired, don't print headers...
    print CGI->redirect("http://some.other.url/");
    exit; 
}

# If no redirect is desired...
print CGI->header();
# etc...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文