Im thankful to you as you are responding to me quickly and giving me the best suggestions............Please help me out from this problem............I've placed the html files in /var/www/html and the perl files in /var/www/cgi-bin...........I'm accessing my perl files using the following address in Mozilla browser
http://localhost:80/cgi-bin/login.pl
but i just cant access the html pages..... can you please give me an idea how to access them? ill paste the code of both perl and html here.
Following is the html page............
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>LOGIN PAGE</title>
</head>
<body>
<br>
<hr style="background-color: rgb(51, 204, 0);">
<h2>
<span style="font-style: italic;"> </span><span
style="color: rgb(51, 51, 255); font-style: italic;">LOGIN PAGE</span></h2>
<h3></h3>
<hr style="background-color: rgb(51, 255, 51);">
<pre> <br> USER: <input type="text" name="user"
size="10"><br>
PASSWORD:<input type="password" name="password" size="10"><br>
</pre>
<pre><br><div style="text-align: center;">
<form action="http://localhost:80/cgi-bin/login.pl" method="post"><input
type="submit" name="SUBMIT" size="10"></form>
</div>
</pre>
</body>
</html>
the PERL file is............
#!/usr/bin/perl
use CGI;
use DBI;
$cgi=new CGI;
print $cgi->header();
my $a=0;
$user=$cgi->param("user");
$password=$cgi->param("password");
$dbh=DBI->connect("DBI:mysql:test:127.0.0.1","mysql","");
$sql=$dbh->selectall_arrayref("select * from login where username='$user' and password='$password'");
foreach $r(@$sql)
{
$a=$a+1;
}
$r=$a;
if($a>0)
{
print"<html><body>";
print"Content-type: text/html\n\n";
print"User Accepted. Welcome <br>\n";
print"<a href=\"http://localhost:80/login.html\">HOME</a>";
print"</body></html>\n";
}
else
{
print"<html><body>";
#print"Content-type: text/html\n\n";
print"User Not Accepted.Check your USERID and PASSWORD>\n";
print"<a href=\"http://localhost:80/index.html\">HOME</a>";
print"</body></html>\n";
}
$st=$dbh->prepare("commit");
$st->execute;
exit;
i can compile the code successfully...........
Please help me in this...........
Thank you
Deepthi
Recent comments
11 hours 26 min ago
16 hours 31 min ago
20 hours 55 min ago
22 hours 44 min ago
1 day 12 hours ago
1 day 13 hours ago
1 day 17 hours ago
2 days 39 min ago
2 days 1 hour ago
2 days 2 hours ago