FurryGorilla
Technical User
Unfortunately I do not have telnet access to my web server so have been trying to write a simple password script.
The script was taken from a tutorial I managed to find but it does not seem to work correctly. The script processes the form input but it does not seem to match up with the array. The password is never accepted unless you leave it blank, in which case it is validated.
The code is as follows:
#!/usr/bin/perl
require "cgi-lib.pl";
%passwords = ( "bob\n"=>"thebobinator\n",
"jeff\n"=>"jeffstheman\n",
"nick\n"=>"irock\n",);
&ReadParse(*input);
$uname = $input{'username'};
$pword = $input{'password'};
print "Content-type: text/html\n\n";
print "<html><body>";
if ($pword eq $passwords{$uname}){
print "Thank you for using our program $name";
}
else{
print "You entered the wrong password, so get lost";
}
print "</body></html>";
Any help would be greatly appreciated
Reagrds
Chris
The script was taken from a tutorial I managed to find but it does not seem to work correctly. The script processes the form input but it does not seem to match up with the array. The password is never accepted unless you leave it blank, in which case it is validated.
The code is as follows:
#!/usr/bin/perl
require "cgi-lib.pl";
%passwords = ( "bob\n"=>"thebobinator\n",
"jeff\n"=>"jeffstheman\n",
"nick\n"=>"irock\n",);
&ReadParse(*input);
$uname = $input{'username'};
$pword = $input{'password'};
print "Content-type: text/html\n\n";
print "<html><body>";
if ($pword eq $passwords{$uname}){
print "Thank you for using our program $name";
}
else{
print "You entered the wrong password, so get lost";
}
print "</body></html>";
Any help would be greatly appreciated
Reagrds
Chris