curtisb has asked for the wisdom of the Perl Monks concerning the following question:
Bobby L. Curtis System Administrator#!/usr/local/bin/perl -w #BurgerDog CGI script/HTML use CGI qw(:standard); #\\Declares global varibles and global arrays # $here = param("location"); $name = param("name"); $email = param("email"); $cost = 0; @food = ('', 'plain dog', 'cheese dog', 'big dog'); @fries = ('', 'yes', 'no'); @onionrings = ('', 'no', 'yes'); @drink = ('', 'pepsi', 'coke'); # #\\Start of the HTML page # print header(), start_html("BurgerDog Resturant"), h1("BurgerDog Order + Form"); if (param()) { return_html(); dborder(); cost(); mailout(); }else{ first_page(); } sub first_page #\\Sets up the default html page with blank fields. { print hr(); print start_form(); print p("Location: ", textfield("location")); print p("Name: ", textfield("name")); print p("Email: ", textfield("email")); print p("What type of BurgerDog would you like? ", popup_menu('foo +d', \@food)); print p("Would you like fries with that? ", popup_menu('Fries', \@ +fries)); print p("Would you like Onion Rings? ", popup_menu('OnionRings', \ +@onionrings)); print p("Would you like a drink? ", popup_menu('drink', \@drink)); print p(submit("Submit Order"), reset("Clear Order")); print end_form(), print hr(); } sub return_html #\\Returns a static html page with variable&arr +ay information. { print hr(), start_html(); print p("$name, you placed an order from $here.\n"); print p("And you would like a $food[$index].\n"); print p("$fries, french fries?\n"); print p("$onionrings, onion rings?\n"); print p("A $drink would be nice with that, Thanks!"); print p("Your total is \$$cost\n"); print p("You can be contacted at $email."); print hr(), end_html(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array problem
by Fastolfe (Vicar) on Sep 23, 2000 at 00:07 UTC | |
|
RE: Array problem
by bastard (Hermit) on Sep 23, 2000 at 01:11 UTC |