>> my $sth = $dbh->prepare($sql);
>> $sth->execute($name,$pass);
>> my $rowref;
>> my $column;
>> my $val;
>> while ($rowref = $sth->fetchrow_hashref()) {
>>#not sure if you will have multiple records so you may need to
>> exit
&g
ltiple records so you may need to
> exit
>#the loop after %record is filled the first time
>while (($column, $val) = each %$rowref) {
> $record{$column} = $val;
>}
> }
> If ($record{'pass'} eq $pass) {
> #redirect to other page
($record{'pass'} eq $pass) {
#redirect to other page
} else {
#stay on logon
}
-M
-Original Message-
From: David Silva [mailto:david...@gmail.com]
Sent: Wednesday, October 14, 2009 6:30 AM
To: dbi-users@perl.org
Subject: Stuck with form validation
Hi everyone,
David Silva wrote:
> Hi everyone,
>
> I have a form with username and password, and when the user enter the right
> user and pass he/she go to other page. (that is my thought)
>
> What i did?
>
> my $dbcon= DBI->connect("dbi:mysql:dbname=dbcontactos","root","");
> my $sql = $dbcon->prepa
Hi everyone,
I have a form with username and password, and when the user enter the right
user and pass he/she go to other page. (that is my thought)
What i did?
my $dbcon= DBI->connect("dbi:mysql:dbname=dbcontactos","root","");
my $sql = $dbcon->prepare("select name,pass from Utilizador