Muskovitz has asked for the wisdom of the Perl Monks concerning the following question:
"login.pl" print <<table; Content-type: text/html\n\n <center> <form action="index.pl" method="GET"> Login to <b>buzzlr.</b><br /><br /> Username: <input type="text" name="username" /><br /><br /> Password: <input type="password" name="password" /><br /><br /> <div align="center"> <input type="submit" name="submit" value="Login" /> </div> </form>
any answers will appreciated!"index.pl" #!/usr/bin/perl use DBI; use DBD::mysql; local ($buffer, @pairs, $pair, $name, $value, %FORM); # Read in text $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/; if ($ENV{'REQUEST_METHOD'} eq "GET") { $buffer = $ENV{'QUERY_STRING'}; } # Split information into name/value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%(..)/pack("C", hex($1))/eg; $FORM{$name} = $value; } $username = $FORM{username}; $password = $FORM{password}; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: why username and password http request showing on the web address
by Perlbotics (Archbishop) on Jan 18, 2015 at 15:32 UTC | |
by Muskovitz (Scribe) on Jan 18, 2015 at 17:13 UTC | |
by Anonymous Monk on Jan 18, 2015 at 21:00 UTC |