我有一個html表格,每行有2個單選按鈕和一個保存按鈕。我想保存時存儲的單選按鈕的值與預設值時,頁面revisited.This是HTML代碼,我已經寫了cgi文件對apache不可見,html表格返回空值
<form action='table_extract.cgi' method = 'post'>
<td><input type='radio' name='signoff' value = 'approve'>Approve<br>
<input type='radio' name='signoff' value='review'>Review</td>
<td><input type='submit' name='button' value='Save'/></td></form>
這是在table_extract.cgi
#!usr/local/bin/perl
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
use warnings;
print <<END;
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
END
my $regfile = 'signoff.out';
my $sign;
$sign = param('signoff');
open(REG,">>$regfile") or fail();
print REG "$sign\n";
close(REG);
print "param value :", param('signoff');
print <<END;
<title>Thank you!</title>
<h1>Thank you!</h1>
<p>signoff preference:$sign </p>
END
sub fail {
print "<title>Error</title>",
"<p>Error: cannot record your registration!</p>";
exit; }
我無法從html格式.cgi
腳本中傳遞參數。我在網上搜索並發現Apache服務器需要可見性的CGI腳本。我試圖檢查加載cgi是否在httpd.conf
上運行,並將cgi腳本移到cgi-bin
。它不起作用。當我嘗試執行.cgi
文件時,仍然會得到空值。
Apaches錯誤和訪問日誌中的任何條目? – Jensd