Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
A couple of tips to help isolate issues between HTML and CGI script:
  1. Print the passed in parameters to the console, and/or
  2. 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.


In reply to Re: cgi based quiz by dbuckhal
in thread cgi based quiz by sargg55

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2022-05-20 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (72 votes). Check out past polls.

    Notices?