#!/usr/local/bin/perl ############################################################################ #Take orders for ice cream shop - using database ############################################################################ use CGI "param"; use DBI; $fname = param('fullname'); $addr = param('addr'); @choice = param('ice'); print "Content-type: text/html \n"; print "\n"; print " Thank You

Thank you for your order

The order will be processed for:

$fname

$addr

$choice[0] "; $dbh = DBI->connect("DBI:mysql:demo","demo","demo"); # typical connection #$dbh = DBI->connect("DBI:mysql:demo:db.it.scps.nyu.edu:3300","demo","demo"); $sql = "insert into ice_orders "; $sql .= "values (0, \'$fname\', \'$addr\' , \'$choice[0]\')"; $rc = $dbh->do($sql); $dbh->disconnect(); exit(0);