#!/usr/bin/perl use strict; use CGI qw(:standard); #n +otifies that CGI will be implemented. print header, start_html("Form"), #start of HTML. h1("Form"); if (param()) { #variable definitions. my $who = param("firstname"); my $who2 = param("lastname"); my $email = param("email"); my $profession = param("profession"); my $creditcard = param("creditcard"); my $creditcardnumber = param("creditcardnumber"); my $question = param("question"); print p("Thank You. Here is your receipt:"); print p("Name: $who $who2"); print p("E- mail: $email"); print p("Profession: $profession"); print p("Credit Card: $creditcard"); print p("Credit Card Number: $creditcardnumber"); print p("Question: $question"); } else { print hr(), start_form(); print p("What's your first name?", textfield("firstname")); print p("What's your last name?", textfield("lastname")); print p("Enter your e- mail address", textfield("email")); print p("What is your profession?", popup_menu("profession", ['Pim +pin', 'Hustlin n Bustlin', 'Crackalakin', 'Playa', 'Thuggin n Buggin' +])); print p("What type of credit card will you be using?", radio_group +("creditcard", ['Asiv', 'Retsam Card', 'Gotham Express'])); print p("Please enter your credit card number:", textfield("credit +cardnumber")); print p("Choose a question:", checkbox_group("question", ['Do you +understand the words coming out of my mouth?', 'Go ahead, want to mak +e my day, punk?', 'Are you ready to get funkafied?'])); print p(submit("Submit"), reset("Reset")); print end_form(), hr(); } print end_html
Love always,
Audrey
Edit by tye, title, preserve formatting, etc.
In reply to Need help with regexes to validate user input by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |