MatthewV has asked for the wisdom of the Perl Monks concerning the following question:
my stored proc looks like this:#!perl -w use strict; use CGI q~:standard~; use DBI; use Digest::MD5 q~md5~; use CGI::Carp q~fatalsToBrowser~; my ($DBH, $STH, $Username, $Password, $Error, $Cookie); $Username = param('Username'); $Password = param('Password'); $Password = md5($Password); $DBH = DBI -> connect ('dbi:ODBC:SQLServer', '', '') or die "$DBI::err +str"; $STH = $DBH -> prepare (qq~exec FinalFantasyInfo.dbo.CheckLogIn ?, \@U +sername = '$Username', \@Password = '$Password'~) or die "DBI::errstr +"; $STH -> bind_param_inout(1, \$Error, 1); $STH -> execute or die "$DBI::errstr"; if ($Error == 1) { print redirect('http://admin.ffinfo.com/login2.html'); } else { $Cookie = new CGI::Cookie (-name => 'FFAdmin0229', -value => ['$Username', '$Password'] ); $Cookie -> bake; print redirect('http://admin.ffinfo.com/portal.html'); }
I have been looking for a while now and just can't see the error, I am sure it is something small and stupid. Can someone give me a second set of eyes and see if they can find it?create proc CheckLogIn ( @Username varchar(50), @Password varchar(50), @Error tinyint output ) as if (select COUNT(*) from FinalFantasyInfo.dbo.MainStaffInfo where UID += @Username and Password = @Password) = '1' set @Error = '0' else set @Error = '1'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need a second set of eyes, can't find the error
by Anonymous Monk on May 02, 2009 at 16:57 UTC | |
by MatthewV (Acolyte) on May 02, 2009 at 19:43 UTC | |
by Anonymous Monk on May 02, 2009 at 21:43 UTC |