#!/usr/bin/perl use CGI; use neweramodels; my $cgi = CGI::new(); my $part_id = $cgi->param("part_id"); if ($part_id){ ## create database handle my $dbh = database_handle(); my $sql = qq[select partnumber from nempartfile where part_id = '$part_id']; my $sth = $dbh->prepare("$sql") || error("$DBI::errstr"); $sth->execute () || error("$DBI::errstr"); my ($partnumber) = $sth->fetchrow_array (); print $cgi->redirect("http://www.neweramodels.com/index.cgi?partnumber=$partnumber"); $sth->finish (); $dbh->disconnect(); exit; } print $cgi->redirect("http://www.neweramodels.com/index.cgi"); exit;