milkchug89
Programmer
I am trying to pass arguments to a cgi script via a web form. The first time your go to the cgi script the script checks to see if you sent it any arguments, if not it starts off with a default login page. You then send the login information back to the script and then it will do some other stuff. The problem I am having is that when I send the login infomation to the script it still thinks there are no arguments. I'm not sure if I'm not checking for parameters right or not sending the form info right
here is the code.
here is the code.
Code:
#!/soft/perl5.8/bin/perl -w
#use strict;
use Fcntl qw/:flock/;
#use warnings;
#use CGI ':standard';
use CGI::Carp;
use File::stat;
use IO::Socket::INET qw(:DEFAULT :crlf);
#use CGI qw(:standard );
use CGI qw(:standard :html3 :netscape -debug);
$q=new CGI;
if(!param()){
print $q->header;
print $q->start_html();
print "the butt of it is ";
print param('control');
print "<br>";
print qq(
<form METHOD="POST" ACTION="[URL unfurl="true"]http://www.itlabs.umn.edu/~hast0044/IMAPClient.cgi">[/URL]
<h1> Please login to the IMAP Server
<br>
<h3>
<input TYPE=TEXT NAME="Login-name" VALUE="" >
<br><br>
UMN Login Name (X.500)
<br>
<br>
<input TYPE=PASSWORD NAME="Password" VALUE="" >
<br><br>
Password
<br>
<br>
<input TYPE=HIDDEN NAME="control" VALUE="login">
<input TYPE=SUBMIT NAME="SubmitButton" VALUE="SUBMIT">
<tr>
<input TYPE=RESET NAME="ResetButton" VALUE="CLEAR">
</form>
);
print $q->end_html;
}
elsif(param('control') eq "login"){
print $q->header;
print $q->start_html();
print qq(
Connected to IMAP Server<br><br>Existing Messages:
163<br><br>Recent Messages: 0<br><br><br><hr>
<form name="form2" method="post" action="">
<div align="center"><p><font size="4">
Range of Email numbers</font>
<input type="text" name="range" size="70">
<input type="submit" name="Submit" value="Range ">
</div>
<br><br><div align="center"><p><font size="4">
LOGOUT</font>
<input type="submit" name="LOGOUT" value="LOGOUT ">
</div>
</form>
);
print $q->end_html;
}