제가 작업하고있는 Perl CGI 퀴즈가 있습니다.하지만 완전히 갇혀 있습니다. 다음과 같이 내 HTML 코드는 다음과 같습니다Perl CGI - 특이성을위한 라디오 값 선택
<p class="question"><br>1. The answer is Number 1 </p>
<ul class="answers">
<input type="radio" name="q1" value="a" id="q1a"><label for="q1a">1912</label><br/>
<input type="radio" name="q1" value="b" id="q1b"><label for="q1b">1922</label><br/>
<input type="radio" name="q1" value="c" id="q1c"><label for="q1c">1925</label><br/>
<input type="radio" name="q1" value="d" id="q1d"><label for="q1d">Summer of '69</label><br/>
</ul>
CGI 프로그램은 매개 변수 값의 라디오 버튼에서 이름을 따기입니다. 내 Perl 코드는 다음과 같습니다 :
if (param("q1") eq undef) {
$an1 = 0;
$winner = 0;
print <<"BIG";
<h1>You didn't enter the right answer</h1>
BIG
}
else {
print <<"BIG";
<h1>You entered the right answer</h1>
BIG
}
이 시점에서 나는 라디오 박스 중 하나를 선택하면 올바른 대답을 입력했다고합니다.
는 매개 변수 a
또는 b
또는 c
또는 d
처럼, 라디오에서 뽑고 가치, 또는 내가 전부 잘못하고 있어요 내가 지정할 수있는 방법이 있습니까?
스택 오버플로 구문 형광펜은 Perl에서는 그리 똑똑하지 않습니다. 하지만 당신 말이 맞습니다. HEREDOC 구분 기호 뒤에 빈 줄이 있어야합니다. – simbabque