的login.html
<form method="POST" action="login.php">
<input type="text" name="username">
<input type="password" name="password">
<button class="_sdf3">Login</button>
</form>
login.pl
#!/usr/bin/perl
use LWP::UserAgent;
my $username = "admin";
my $password = "pass2321";
my $url = "http://127.0.0.1/login.html";
my $ou = new LWP::UserAgent;
my $req = $ou->post($url,{ username => $username , password => $password , });
my $code = $req->code;
if ("$code" eq "302"){
print "Username And Password OK";
}else{
print "Username And Password BAD";
}
当我运行login.pl
时,我会看到Username And Password BAD
,但数据是正确的!!
我想在login.html
中使用<button class="_sdf3">Login</button>
时解决此问题
答案 0 :(得分:0)
您要发布到login.html
,但您应该发布到login.php
。