带有password_field参数的cgi脚本 [英] cgi script with password_field parameter

查看:69
本文介绍了带有password_field参数的cgi脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有这个cgi脚本,这是一个简单的身份验证网页,它检查password_field的值,如果正确调用子程序alfa。


当我点击插入新流时,我不知道为什么它会因错误而停止


我试图在没有认证的情况下调用子程序部分而且有效。

Hi,

I have this cgi script which is a simple authentication web page, it check the value of the password_field and if correct call the subroutine alfa.

I don''t know why it stops with an error when I click on "insert new stream"

I tried to call the subroutine without the authentication part and it works.

展开 | 选择 | Wrap | 行号

推荐答案

第16行,如下所示:

In line 16, shown here:

展开 | 选择 | Wrap | 行号


以下是您需要考虑的一些问题。当你回答它们时,你的问题和解决方案应该被发现。


你为什么要加载CGI模块两次?


你为什么使用CGI的OO接口在开始但后切换到sub中的功能接口?


为什么你在sub中有use语句而不是在开头的脚本?


为什么在子程序声明中指定一个空原型?您应该收到此警告:
Here are some questions for you to think about. As you answer them, your problem and solution should be discovered.

Why are you loading the CGI module twice?

Why are you using CGI''s OO interface in the begining but then switch over to the functional interface in the sub?

Why do you have the use statements in the sub and not at the beginning of the script?

Why are you specifying an empty prototype in the subroutine declaration? You should be receiving this warning:

main :: alfa()过早调用m4x123.pl第16行检查原型
main::alfa() called too early to check prototype at m4x123.pl line 16



为什么要附上印刷品错误;在它自己的块中声明?


为什么要输出2组标题?

Why are you enclosing the print ''error''; statement in it''s own block?

Why are you outputting 2 sets of headers?


我没有测试过脚本但是我没有我认为打印错误声明会阻止脚本正常工作。


修复了else块的格式后,这就是它的样子。
I have not tested the script but I don''t think that print error statement prevented the script from working correctly.

After fixing the formatting of that else block, here is what it looks like.
展开 | 选择 | Wrap | 行号


这篇关于带有password_field参数的cgi脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆