Here is the module that I createdmy $q = new CGI; my($surname, $givenName); $ENV{REMOTE_USER} = $q->param('Login_Name'); my $room = $q->param('Room'); my $sth; my $table = SQL->new(); my $dbh= DBI->connect("dbi:Oracle:", "scott", "tiger") or die $DBI::er +rstr; if (!($dbh->selectrow_array("select * from user_tables where table_nam +e = '$table->{name}'"))){ $sth= $dbh->prepare($table->create) or die $dbh->errstr; $sth->execute or die $sth->errstr; } $sth = $dbh->prepare(q/INSERT INTO SignIn(cn, time, cdate, room) VALUE +S (?,?,?,?)/) or die $dbh->errstr; $sth->execute($ENV{REMOTE_USER}, $foo, $foo, $room); print <<ENDOFHTML $ENV{REMOTE_USER}, $time, $date, $room Content-type:text/html\n\n <html> <body> <SCRIPT language="JavaScript"> alert("$givenName $surname you have signed in successfully on $fullDat +e. Thank you and enjoy Computers 101.") </SCRIPT> </body> </html> ENDOFHTML
Thanks for any helppackage SQL; sub new{ my $self = {}; $self->{name}='SIGNIN'; bless $self; return $self; } sub create{ my $self = shift; $self->{create} = "create table SignIn (cn varchar2(64), time varc +har2(10), cdate varchar2(20), room varchar2(20))"; return $self->{create}; } sub index{ my $self = shift; $self->{index} = "create index CNIndex on self->{name}(cn)"; return $self->{index}; } 1;
In reply to connect to Oracle through CGI by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |