projects
/
technostate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
914bb1c
)
*** empty log message ***
author
ivan
<ivan>
Thu, 22 Apr 1999 06:24:57 +0000
(06:24 +0000)
committer
ivan
<ivan>
Thu, 22 Apr 1999 06:24:57 +0000
(06:24 +0000)
cgi/persons.cgi
patch
|
blob
|
history
cgi/sets.cgi
patch
|
blob
|
history
diff --git
a/cgi/persons.cgi
b/cgi/persons.cgi
index
1f1501c
..
e4eb179
100755
(executable)
--- a/
cgi/persons.cgi
+++ b/
cgi/persons.cgi
@@
-1,5
+1,5
@@
#!/usr/bin/perl -Tw
#!/usr/bin/perl -Tw
-# $Id: persons.cgi,v 1.
8 1999-04-22 06:06:16
ivan Exp $
+# $Id: persons.cgi,v 1.
9 1999-04-22 06:24:57
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
# 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
@@
-82,13
+82,18
@@
unless ( $cgi->param('magic') ) { #first time through
foreach $field ( @fields ) {
if ( $cgi->param( $field ) ) {
$cgi->param( $field ) =~ /^(.*)$/;
foreach $field ( @fields ) {
if ( $cgi->param( $field ) ) {
$cgi->param( $field ) =~ /^(.*)$/;
- $cgi->param( $field, $1);
+ my $param = $1 || 0;
+ if ( (DBI::looks_like_number($param))[0] ) {
+ $cgi->param( $field, $param );
+ } else {
+ $cgi->param( $field, $dbh->quote($param) );
+ }
}
}
my $statement = "INSERT INTO $table ( ".
join(', ', @fields ).
' ) VALUES ( '.
}
}
my $statement = "INSERT INTO $table ( ".
join(', ', @fields ).
' ) VALUES ( '.
- join( ', ', map { $
dbh->quote($cgi->param($_)
) } @fields ).
+ join( ', ', map { $
cgi->param($_
) } @fields ).
' )'
;
my $sth = $dbh->prepare($statement)
' )'
;
my $sth = $dbh->prepare($statement)
diff --git
a/cgi/sets.cgi
b/cgi/sets.cgi
index
7be457d
..
e5c64b1
100755
(executable)
--- a/
cgi/sets.cgi
+++ b/
cgi/sets.cgi
@@
-1,5
+1,5
@@
#!/usr/bin/perl -Tw
#!/usr/bin/perl -Tw
-# $Id: sets.cgi,v 1.
4 1999-04-22 06:06:1
6 ivan Exp $
+# $Id: sets.cgi,v 1.
5 1999-04-22 06:21:0
6 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
# 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
@@
-71,22
+71,29
@@
unless ( $cgi->param('magic') ) { #first time through
exit;
} elsif ( $cgi->param('magic') eq 'process_form' ) {
exit;
} elsif ( $cgi->param('magic') eq 'process_form' ) {
+ $cgi->param('FILESIZE', 0);
+ $cgi->param('DOWNLOADS', 0);
+
my $field;
foreach $field ( @fields ) {
if ( $cgi->param( $field ) ) {
$cgi->param( $field ) =~ /^(.*)$/;
my $field;
foreach $field ( @fields ) {
if ( $cgi->param( $field ) ) {
$cgi->param( $field ) =~ /^(.*)$/;
- $cgi->param( $field, $1);
+ my $param = $1 || 0;
+ if ( (DBI::looks_like_number($param))[0] ) {
+ $cgi->param( $field, $param );
+ } else {
+ $cgi->param( $field, $dbh->quote($param) );
+ }
}
}
}
}
- $cgi->param('FILESIZE', 0);
- $cgi->param('DOWNLOADS', 0);
my $statement = "INSERT INTO $table ( ".
join(', ', @fields ).
' ) VALUES ( '.
my $statement = "INSERT INTO $table ( ".
join(', ', @fields ).
' ) VALUES ( '.
- join( ', ', map { $
dbh->quote($cgi->param($_)
) } @fields ).
+ join( ', ', map { $
cgi->param($_
) } @fields ).
' )'
;
' )'
;
+ warn $statement;
my $sth = $dbh->prepare($statement)
or die $dbh->errstr;
my $rv = $sth->execute;
my $sth = $dbh->prepare($statement)
or die $dbh->errstr;
my $rv = $sth->execute;
@@
-105,7
+112,7
@@
sub print_form {
$cgi->start_html($action),
$cgi->h1($action),
$cgi->start_form,
$cgi->start_html($action),
$cgi->h1($action),
$cgi->start_form,
- $cgi->hidden( -name => 'ID' ),
+ $cgi->hidden( -name => '
SET_
ID' ),
"Start Time: ", $cgi->textfield( -name => 'SETSTART' ), "<BR>",
"Length: ", $cgi->textfield( -name => 'DURATION' ), "<BR>",
"Filename: ", $cgi->textfield( -name => 'FILENAME' ), "<BR>",
"Start Time: ", $cgi->textfield( -name => 'SETSTART' ), "<BR>",
"Length: ", $cgi->textfield( -name => 'DURATION' ), "<BR>",
"Filename: ", $cgi->textfield( -name => 'FILENAME' ), "<BR>",