A couple of tips to help isolate issues between HTML and CGI script:
- Print the passed in parameters to the console, and/or
- Supply the values in the CGI and check the script output (shown below)
.
.
.
my ($grp1,$grp2,$grp3) = qw{ Correct1 Incorrect2 Correct3}; # explicit
+ values
# $grp1 = param('grp1'); # passed in values
# $grp2 = param('grp2');
# $grp3 = param('grp3');
if ($grp1 eq "Correct1" )
{
print p("Question One Is $grp1");
}
elsif ($grp1 eq"Incorrect1")
{
print p(" Question One is $grp1");
}
if ($grp2 eq "Correct2")
{
print p("Question One Is $grp2");
}
elsif ($grp2 eq"Incorrect2")
{
print p(" Question One is $grp2");
}
if ($grp3 eq "Correct3")
{
print p("Q3 is $grp3" ) ;
}
elsif ($grp3 eq "Incorrect3")
{
print p("q3 is $grp3");
}
__output__
Content-Type: text/html; charset=ISO-8859-1
<p>Question One Is Correct1</p><p> Question One is Incorrect2</p><p>Q3
+ is Correct3</p>
So, it would appear the script is correct, and that the problem may lie in the HTML.
I know these are basic tips, but basic things can get easily overlooked.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.