Hi, im currently designing a simple Oracle database for a project and need to run queries to add, delete, view, etc records. The data for the queries is inputed into fields in a html page and the results are returned. Each html page I have (view, add, etc) has fields for the user to enter their username and password before the other fields that need to be complteted.
What I would like to do is make it so that the user only has to log in once, either on the homepage or the first time they actually run a query. Each time after that the html page in view (view, add, etc) has the users login name at the top and the option to log out.
This is the code im using for the add to database function:
#!/usr/local/bin/perl -w
#insert.pl
use DBI;
use CGI;
$rgt = new CGI;
$user = $rgt->param("user");
$pwd = $rgt->param("pwd");
$deptno = $rgt->param("deptno");
$deptname = $rgt->param("deptname");
$loc = $rgt->param("loc");
$dname =~ tr/a-z/A-Z/;
$loc =~ tr/a-z/A-Z/;
$ENV{ORACLE_HOME}="/u22/Oracle/9.0.1";
$ENV{ORACLE_SID}="shu9i";
$db = DBI->connect( "DBIš®racle(RaiseError=>1):shu9i", $user, $pwd) or die
"Cannot connect to Oracle instance: $db->errstr\n";
$qry = "INSERT into DEPT values (" .$deptno. ", '" .$deptname. "', '" .$loc.
"')";
$cursor = $db->prepare($qry) or die "Cannot prepare cursor\n";
$cursor->execute or die "Unable to execute SQL command\n";
$cursor->finish or die "Cannot close cursor\n";
$db->disconnect or die "Cannot disconnect from Oracle instance\n";
print "Content-type: text/html\n\n";
print "<HEAD><TITLE>Insert</TITLE></HEAD><body bgcolor=#CDCDCF><table align=center><hr>";
print "<h3>Operation completed for user <font color=blue>" . $user . "</font>!</h3><hr><p>Department number <font color=blue> " .$deptno. " </font>, named <font color=blue> " .$deptname. "</font>, at location <font color=blue> " .$loc." </font> has successfully been added to the DEPT table. Thank You";
print "</table></body>";
exit(0);
Im a bit new to this so any help would be appreciated....thanks