#!/usr/bin/perl use CGI qw(:standard -debug); print "Content-type: text/html\n\n"; #assign input items to variables my $action = param('action'); my $pname = param('pname'); my $unit = param('unit'); my $qty = param('qty'); my $cost = param('cost'); if ($pname eq "" or $unit eq "" or $qty eq "" or $cost eq "") { print "

Please fill in the form completely. Use your backspace button to go back and complete the form

\n"; print "\n"; }else { insert into products (pname, unit, qty, cost) values ('pname', 'unit', 'qty', 'cost'); }