Hi,
Home page is having username and password and submit button in html file... while clicking the submit button its redirecting to next page which is /cgi-bin folder abc.pl file..
In this file having perl code which is connecting to the database.. and want to show the output again in browser... below is the perl code..
#! /usr/bin/perl
use strict;
use DBI;
use CGI qw/:standard/;
print "Content-type: text/html\n\n";
sub connect(){
print "<html><head>\n";
print "<title>Hello, world!</title></head>\n";
print "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#FF0000\" vlink=\"#800000\">\n";
print "<h1>Hello, world!</h1>\n";
print "</body></html>\n";
my $dbh = DBI->connect( 'dbi:Oracle:INDIA','abc','
abc'') || die "Database connection not made: $DBI::errstr";
print "<html><head>\n";
print "<title>Hello, world!</title></head>\n";
print "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#FF0000\" vlink=\"#800000\">\n";
print "<h1>Hello, world!</h1>\n";
print "</body></html>\n";
$dbh->disconnect();
}
print "<html><head>\n";
print "<title>Hello, world!</title></head>\n";
print "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#FF0000\" vlink=\"#800000\">\n";
print "<h1>Hello, world!</h1>\n";
&connect();
print "<a href=\"../perl/tutorial.ht
ml\"><b>Ba
ck</b></a>
to the Tutorial\n";
print "</body></html>\n";
a)while running as a standalone output mean from the command prompt ..its working fine..and shows the output only three print statements.. after the connect statement there is having another print statement that wihch is not giving the output.. on command prompt ...also
output from the command prompt :
[root@standby cgi-bin]# perl abc.pl
Content-type: text/html
<html><head>
<title>Hello, world!</title></head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#800000">
<h1>Hello, world!</h1>
<html><head>
<title>Hello, world!</title></head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#800000">
<h1>Hello, world!</h1>
</body></html>
<html><head>
<title>Hello, world!</title></head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#800000">
<h1>Hello, world!</h1>
</body></html>
<a href="../perl/tutorial.htm
l"><b>Back
</b></a> to the Tutorial
</body></html>
b)while clicking the submit buton on the first page it redirects to /cgi-bin/abc.pl and its not showing any output.. its displaying a blank page.. and the status bar at the below is showing Done..
Please let me know where is the problem..
Thanks...
Start Free Trial