#!/usr/bin/perl use DBI; print "Content-type:text/html\n\n"; $dbh = DBI->connect( "dbi:mysql:products", "webserver", "") or dienice("Can't connect: ",$dbh->errstr); print <Kite Catalog

Kite Catalog

To order, enter the quantity in the input box next to the item.

EndHdr $sth = $dbh->prepare("select stocknum,name,price from items where status != \"OUT\" order by stocknum") or dienice("Can't select from table: ",$dbh->errmsg); $sth->execute; while (($stocknum,$name,$price) = $sth->fetchrow) { print " $name - \$ $price

\n"; } $dbh->disconnect; print <

EndFoot sub dienice { my($msg) = @_; print "

Error

\n"; print $msg; exit; }