Voila, c'est mon code de debut de mon formulaire comme je l'avais laisser y'a qques jours.
Code :
- #!/usr/bin/perl
- use strict;
- use CGI qw(:standard);
- #-------------------------------------------------------------------------------
- # CGI form for appliance energy use measurements
- #-------------------------------------------------------------------------------
- my $cgi = new CGI;
- if ($cgi->param("submit" )) {
- if ($cgi->param("type" ) eq "Refrigerator" ) {
- html_q2refrig();
- # if ($cgi->param("submit1" )) {
- # html_q3refrig();
- # }
- }
- elsif ($cgi->param("type" ) eq "Washing_machine" ) {
- html_q2washing();
- }
- elsif ($cgi->param("type" ) eq "Clothes_dryer" ) {
- html_q2dryer();
- }
- elsif ($cgi->param("type" ) eq "Room_air_conditionner" ) {
- html_q2roomac();
- }
- } else {
- html_q1();
- }
- #------------------------------------------------------------------------------
- # ASKING FOR THE TYPE OF APPLIANCE
- #------------------------------------------------------------------------------
- sub html_q1 {
- print "Content-type: text/html\n\n";
- print '
- <html>
- <head>
- <title>Protocol for measuring appliances energy use</title>
- </head>
- <body bgcolor="aliceblue"><center><h2>Protocol for measuring appliance energy use <br>(step 1)</h2></center>
- <br>
- <hr>
- <br><br>
- <form method="post">
- <font size="4"><b>What type of appliance did you use for this measurement ?</b></font><br><br>
- <select name="type" size="1">
- <option value="Refrigerator" selected>Refrigerator</option>
- <option value="Clothes_dryer">Clothes Dryer</option>
- <option value="Room_air_conditionner">Room air-conditionner</option>
- <option value="Washing_machine">Washing machine</option>
- </select>
- <br><br>
- <div align="center"><input type="submit" name="submit" value="Submit"><input type="reset" name="Reset"></div>
- </form>
- </body>
- </html> ';
- }
|
j'aimerais savoir comment recuperer le parametre "type" dans une variable et aussi ou je dosi inserer le commande qui permet de le faire ... (je sais c'est la base mais la j'en peux plus de chercher )