Walter_T has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -wT use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; use DBI; print header; print start_html("Login"); print h4("Login Engineer Form"); our ($p,$l,$a,$z,$id,$user,$password,$role,$query); $query = new CGI; foreach my $p (param()) { $l = param('fname'); $a = param('userpassword'); $z = param('selectrole'); } my $dbh = DBI->connect( "dbi:SQLite:dbname=master_train.db", { RaiseError => 1 } ) or die $DBI::errstr; my $sth = $dbh->prepare( "SELECT * FROM users" ); $sth->execute(); while(($id, $user, $password, $role)=$sth->fetchrow_array){ our ($l,$a,$z); if(($l eq $user)&&($a eq $password)&&($z eq $role)){ if($role eq $z){ print redirect("http//192.168.1.5/train/main.htm") +; } else { print redirect("http://192.168.1.5/train/login +.htm"); } } } $dbh->disconnect(); print end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 302 Found Location Message
by haukex (Archbishop) on Mar 09, 2020 at 17:56 UTC | |
by Walter_T (Initiate) on Mar 09, 2020 at 18:10 UTC | |
|
Re: 302 Found Location Message
by haukex (Archbishop) on Mar 09, 2020 at 20:45 UTC | |
|
Re: 302 Found Location Message
by AnomalousMonk (Archbishop) on Mar 09, 2020 at 21:35 UTC |