mojobozo has asked for the wisdom of the Perl Monks concerning the following question:
#!usr/bin/perl use DBI; use CGI qw/:standard/; print header(); my $q = new CGI; my $oldpw = $q->param('txtPasswordOld'); my $newpw1 = $q->param('txtPasswordNew1'); my $newpw2 = $q->param('txtPasswordNew2'); my $name = $q->param('txtName'); my $user = ""; my $pwd = ""; my $server = "localhost"; my $db = "my_db"; my $dbh = DBI->connect("dbi:mysql:$db:$server",$user,$pwd); print "<html><body>"; if ($newpw1 eq $newpw2){ my $query = "UPDATE User SET Password = Password($newpw1) where User +='$name'"; my $sth = $dbh->prepare($query); $sth->execute(); print "Password changed."; } print "</body></html>"; $dbh->disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI and DBI, new to me...
by Ryszard (Priest) on Dec 13, 2002 at 19:07 UTC | |
by dga (Hermit) on Dec 13, 2002 at 22:59 UTC | |
|
(jeffa) Re: CGI and DBI, new to me...
by jeffa (Bishop) on Dec 13, 2002 at 20:37 UTC | |
|
Re: CGI and DBI, new to me...
by tadman (Prior) on Dec 13, 2002 at 19:49 UTC | |
by mojobozo (Monk) on Dec 13, 2002 at 19:56 UTC | |
by chromatic (Archbishop) on Dec 13, 2002 at 20:01 UTC | |
|
Re: CGI and DBI, new to me...
by scain (Curate) on Dec 13, 2002 at 19:19 UTC |