Dear Friends,
I am new to perl/cgi and trying to do the following :
I have installed Apache 1.3.19 webserver on Solaris 2.6 machine. What I am trying to
do is, to get the input in web browser and pass this input to Oracle-SQL, get back the
result to the browser. I am trying the below scripts, it fails. I am getting the empty
screen. Can anyone help me where I am doing mistake ?.
user.html
<HTML>
<HEAD>
<TITLE>Internal Use Only</TITLE>
</HEAD>
<BODY>
<FORM Action="/cgi-bin/test.pl">
<P>Enter Your UserID : <INPUT NAME="userid">
<P><INPUT TYPE="SUBMIT" VALUE="Submit">
</FORM>
</BODY>
</HTML>
/cgi-bin.test.pl
print "Content-type: text/plain\n\n";
use CGI qw(:standard);
use DBI;
$user=param('userid');
$dsn="dbi:Oracle:test";
$user="test";
$password="test";
$dbh=DBI->connect($dsn,$user,$password)||die "cannot connect";
$sth=$dbh->prepare("SELECT USERID,USERINDEX FROM USERS WHERE USERID='$user'");
$sth->execute();
while(@row=$sth->fetchrow_array) {
print "@row\n";
}
$dbh->disconnect();
Thanks in advance.
Regards,
Sikkandar