X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=cgi%2Fpersons.cgi;h=4733ccd69cfd33c49479839c031bc33e574ca134;hb=c3c2bd39d9b8ddfc300550bb30f78e602862742e;hp=e06212473c870d8caced8afdc511713ca4ac95b8;hpb=6b4cfe699a76082754a85aeb4637d9683b3c8f3f;p=technostate.git diff --git a/cgi/persons.cgi b/cgi/persons.cgi index e062124..4733ccd 100755 --- a/cgi/persons.cgi +++ b/cgi/persons.cgi @@ -1,5 +1,5 @@ #!/usr/bin/perl -Tw -# $Id: persons.cgi,v 1.3 1999-04-22 04:27:47 ivan Exp $ +# $Id: persons.cgi,v 1.4 1999-04-22 04:33:05 ivan Exp $ # Copyright (c) 1999 Ivan Kohler. All rights reserved. # This program is free software; you can redistribute it and/or modify it under # the same terms as perl itself @@ -65,13 +65,18 @@ unless ( $cgi->param('magic') ) { #first time through &print_form( $cgi, "Add person" ); exit; } elsif ( $cgi->param('magic') eq 'process_form' ) { - foreach $field ( @fields ) { - if $cgi->param( $field ) - my $statement = 'INSERT INTO PERSONS ( ', - join(', ', @fields ), - ' ) VALUES ( ', - join( ', ', map { $cgi->param($_) } @fields ), + my $field; + foreach $field ( @fields ) { + if ( $cgi->param( $field ) ) { + $cgi->param( $field ) =~ /^(.*)$/; + $cgi->param( $field, $1); + } + } + my $statement = 'INSERT INTO PERSONS ( '. + join(', ', @fields ). + ' ) VALUES ( '. + join( ', ', map { $cgi->param($_) } @fields ). ' )' ; my $sth = $dbh->prepare($statement)