0
我想写显示在同一时间只有一个问题,每一个单独的页面上进行了调查。我无法弄清楚如何让我的CGI文件完成这个任务,现在我已经在一个页面上拥有了所有内容,但是希望我的用户能够点击“下一个”按钮来为他们提出一个新问题。我正试图用Perl和HTML来完成这项工作。例如:链接的网页与CGI脚本
use CGI qw(:standard); # Include standard HTML and CGI functions
use CGI::Carp qw(fatalsToBrowser); # Send error messages to browser
#
# Start by printing the content-type, the title of the web page and a heading.
#
print header, start_html("Hello"), h1("Hello");
if (param()) { # If true, the form has already been filled out.
$who = param("myname");
$cats = param("cats"); # Extract the value passed from the form.
if($cats == "Y"){
print p("Hello, your name is $who, and you like cats");
}
else{
print p("Hello, your name is $who, and you don't like cats"); # Print the name.
}
}
else { # Else, first time through so present form.
print start_form();
print p("What's your name? ", textfield("myname"));
print p("Do you like cats? Y for yes and N for no", textfield("cats"));
print p(submit("Submit form"), reset("Clear form"));
print end_form();
}
print end_html;
如果我想猫质疑出现在接下来的页面上,通过取出提交按钮和一个推杆,其功能就像一个未来,我必须按钮链接到另一个页面或这可以在一个脚本中实现吗?简而言之,您是否可以创建并链接多个html页面以仅使用一个cgi脚本进行调查?
谢谢我一回家就会检查一下 –