List:General Discussion« Previous MessageNext Message »
From:Douglas Brantz Date:April 2 2000 4:42pm
Subject:Newbie Question about Error Display.?
View as plain text  
I am working with apache on Linux and have the latest version of Mysql
and am building an html interface for accessing a Mysql database.  I
have the admin enter a username password in the form and everything
works great and if the enter the wrong username or password the browser
dispays an error no data - which is ok, but IE displays a white page
with no error - now my question.

What is the best way to display an error that you can't connect if the
username and password are not
correct to open the database?  I user javascript to valadate for the
field in the form.

Can or should I actually make a call to the permissions table-mysql
mysql?  I don't think that would be wise or maybe I can create a
username and password that can grab the info needed from the mysql mysql
database to validate the admin user?

basically I am using  the following to open the database:
my $usrn = $query->param("ADMINUSER");
$usrn = lc($usrn);
my $pass2 = $query->param("ADMINPASS");
$pass2 = lc($pass2);

my $dbh = Mysql->connect("Localhost","timeclock",$usrn,$pass2);

my $command="";
blah blah blah

my $sth = $dbh->query($command);

die "error with command \"$command\""
      unless (defined $sth);

All I am looking for is a way to post a message back to the admin
stating that the database could not be opened because the $usrn and
$pass2 did not work and then I guess I'd like to use a meta line to jump
the admin back to the form page.

Any help would be greatly appreciated.

Thanks,

Douglas

Thread
Newbie Question about Error Display.?Douglas Brantz2 Apr