b310 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -Tw use CGI qw(:standard); use strict; use lib qw(/export/ext2/www/bartellmachinery/library); use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard escape escapeHTML); use WebDB; my $cust_ref; #reference to customer #@PAGE_START my $dbh = WebDB::connect (); my $page = h3 ({-align=>"center"}, ("Order Tracking System")); #@PAGE_START # get the form parameters $cust_ref->{custid} = param ("custid"); my $choice = lc (param ("choice")); if ($choice eq "submit") # customer submitted ID number { $page .= get_customer ($dbh, $cust_ref); } else { $page .= p (escapeHTML ("Logic error, unknown choice: $choice")); } print header (), start_html (-title => "Order Tracking System", -bgcol +or => "white"); sub get_customer { my ($dbh, $cust_ref) = @_; my ($page); my $sth = $dbh->prepare ("SELECT * FROM Shipments WHERE customer_id = +?"); $sth->execute ($cust_ref->{custid}); my @rows; while (my $order_ref = $sth->fetchrow_hashref ()) { push @rows, Tr ({-style=>"font-family: verdana; font-size: 10pt;"}, td ({-colspan => "2"}, ""), td ({-colspan => "3", -align=>"right", -style=>"font-weight: +700;"}, "Customer ID:"), td (escapeHTML ($order_ref->{customer_id)), ); Tr ({-style=>"font-family: verdana; font-size: 10pt;"}, td ({-colspan => "2"}, ""), td ({-colspan => "3", -align=>"right", -style=>"font-weight: +700;"}, "Tracking Number:"), td (escapeHTML ($order_ref->{tracking_number)), ); $page .= table ({-border => 1, -align => "center"}, return ($page); $sth->finish(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Compilation Error
by vek (Prior) on Jun 02, 2003 at 16:57 UTC | |
by b310 (Scribe) on Jun 02, 2003 at 17:41 UTC | |
by vek (Prior) on Jun 02, 2003 at 17:47 UTC | |
|
Re: Compilation Error
by shemp (Deacon) on Jun 02, 2003 at 16:47 UTC | |
|
Re: Compilation Error
by WhiteBird (Hermit) on Jun 03, 2003 at 00:18 UTC |