% my %link_field = ( 'svc_acct' => 'username', 'svc_domain' => 'domain', ); my %link_field2 = ( 'svc_acct' => { label => 'Domain', field => 'domsvc', type => 'select', select_table => 'svc_domain', select_key => 'svcnum', select_label => 'domain' }, ); my($query) = $cgi->keywords; my($pkgnum, $svcpart) = ('', ''); foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart $pkgnum=$1 if /^pkgnum(\d+)$/; $svcpart=$1 if /^svcpart(\d+)$/; } my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); my $svc = $part_svc->getfield('svc'); my $svcdb = $part_svc->getfield('svcdb'); my $link_field = $link_field{$svcdb}; my $link_field2 = $link_field2{$svcdb}; %> <%= header("Link to existing $svc") %>