<form name="login" action="$cgidir?action=verify_login" method="POST">
The above doesn't look right to me. To get it to work I put it in an html document like the following:
<html>
<header>
<title>Post form example</title>
</header>
<body>
<form name="login" action="/cgi-bin/verify_login" method="POST">
<input type="text" name="user">
<input type="password" name="pass">
<input type="submit" name="login" value="Login">
</form>
</body>
</html>
Then your verify_login can read what the form POSTed by using the CGI module and its param method.
#!/usr/bin/perl
#/cgi-bin/verify_login
use strict;
use warnings;
use CGI qw(:standard);
my $cgi=new CGI; #read in parameters
print $cgi->header(); #print a header
print $cgi->start_html("Welcome"); #generate HTML document start
print "<h1>Welcome, ",$cgi->param('user'),". Your password is ",$cgi->param('pass'),"</h1></p>";
print "But I won't tell anyone.</p>";
print $cgi->end_html();#finish HTML document d5e5
Practically a Posting Shark
810 posts since Sep 2009
Reputation Points: 159
Solved Threads: 159