cgi-dev

Repository that serves as my CGI "scratchpad" to try things out.
git clone git://git.samirparikh.com/cgi-dev
Log | Files | Refs | README

notify_signup.cgi (1438B) - raw


      1 #!/usr/bin/perl
      2 
      3 use strict;
      4 use warnings;
      5 use CGI;
      6 
      7 my $form = CGI->new;
      8 
      9 print $form->header( "text/html" );
     10 print $form->start_html( -title => "Register to our Mailing List" );
     11 print $form->h1( "Mailing List Signup" );
     12 print $form->p( "Please fill out this form to be notified via email
     13                  about updates and future product announcements." );
     14 
     15 print $form->start_form(
     16                         method => "register.cgi",
     17                         action => "POST",
     18 );
     19 
     20 foreach (qw( Name Email )) {
     21     print $form->p( "$_:", $form->textfield( -name => lc( $_ ) ) );
     22 }
     23 
     24 print $form->p( "Password:", $form->password_field( -name => "password" ) );
     25 
     26 print $form->checkbox(
     27                         -name  => "checkbox",
     28                         -value => "my_checkbox",
     29                         -label => "My Checkbox",
     30 );
     31 
     32 print $form->checkbox_group (
     33                         -name   => "toppings",
     34                         -values => [ qw( lettuce tomato onions ) ],
     35                         -labels => { "lettuce" => "Lettuce",
     36                                      "tomato"  => "Tomato",
     37                                      "onions"  => "Onions",
     38                                    },
     39                         -columns => 1,
     40 );
     41 
     42 print $form->hr;
     43 
     44 print $form->submit(
     45                         -name => "submit",
     46                         -value => "Submit Now",
     47 );
     48 
     49 print $form->reset;
     50 
     51 print $form->end_form;
     52 print $form->end_html;