but i got problem getting it work
the html code is:
Expand|Select|Wrap|Line Numbers
- <HTML>
- <HEAD>
- <TITLE>HTML Form Example</TITLE>
- </HEAD>
- <BODY>
- <FORM method="GET" action="c:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/lesson2.pl">
- <h3>Your First Name:</h3>
- <p><INPUT type="text" name="FirstName"></p>
- <h3>Your Last Name:</h3>
- <p><INPUT type="text" name="LastName"></p>
- <h3>Check if you are a student:</h3>
- <p><INPUT type="checkbox" name="isStudent"></p>
- <h3>What is your gender?</h3>
- <p>
- <INPUT type="radio" name="Gender" value="isMale">Male
- <INPUT type="radio" name="Gender" value="isFemale">Female
- </p>
- <h3>How many moons are there on your planet?</h3>
- <p>
- <SELECT name="numMoons" size="5">
- <OPTION value="1" selected>Only One Moon
- <OPTION value="2">Two Nice Moons
- <OPTION value="3">A Fine Triplet
- <OPTION value="4">Four Celestial Bodies
- <OPTION value="5-8">Between Five and Eight
- <OPTION value="9-12">We Have Between Nine and Twelve
- <OPTION value="lots">Too Many To Count!
- </SELECT>
- </p>
- <h3>Comments:</h3>
- <p><TEXTAREA rows="10" cols="80">Type Comments Here</TEXTAREA></p>
- <h3>Hidden Data!</h3>
- <p><INPUT type="hidden" name="Secret" value="Invisible"></p>
- <h3>Submit this Form</h3>
- <p><INPUT type="submit" value="Send Data Now!"></p>
- <h3>Reset this Form</h3>
- <p><INPUT type="reset" value="Clear all my input now"></p>
- </FORM>
- </BODY>
- </HTML>
Expand|Select|Wrap|Line Numbers
- #!/perl/bin/perl
- use strict;
- use CGI;
- my $cgi = new CGI;
- $cgi->header(),
- $cgi->start_html( -title=>'Form Results',
- -author=>'Craig Kelly'),
- $cgi->h1('Form Results'), "\n";
- my @params=$cgi->param();
- print '<TABLE border="1" cellspacing="0" cellpadding="0">', "\n";
- foreach my $parameter (sort @params){
- print "<tr><th>$parameter</th><td>", $cgi->param($parameter), "</td></tr>\n";
- }
- print "</TABLE>\n";
- print $cgi->end_html;
- exit(0);
but each time i click on my submit button,
instead of bringing me to the page with my tables and results
it's giving me a prompt of weather i wanna open the lesson2.pl script
any idea why?