cdubbs94 has asked for the wisdom of the Perl Monks concerning the following question:
and have it log into my webmail automatically. I know this will work because I currently use JavaScript to do this, however I realize the risk of having my password available to anyone who views the code of my login page. Could any help me out on how I could accomplish what I have below?
Thanks so much,
Chris
#!/usr/bin/perl ###################################################################### # Function : # # Load Webmail using the password provided # # Use it : # # webmail?username=myusername&password=mypassword&domain=mydomain # ###################################################################### my $username = param('username'); my $password = param('password'); my $domain = param('domain'); if ($username eq ""){ print "No username given.\n"; print "Correct Usage: webmail.cgi\?username=YourUsername\&pass +word=YourPassword\&domain=YourDomain"; } elsif ($password eq ""){ print "No password given.\n"; print "Correct Usage: webmail.cgi\?username=YourUsername\&pass +word=YourPassword\&domain=YourDomain"; } elsif ($domain eq ""){ print "No domain given\n" print "Correct Usage: webmail.cgi\?username=YourUsername\&pass +word=YourPassword\&domain=YourDomain"; } else print "<HTML><HEAD><TITLE>Logging In...</TITLE></HEAD><BODY>"; print "<CEN_TER><B_>Logging into your webmail...please wait... +</_B></CEN_TER>"; print "<FORM name=f action=https://webmail.com/redirect.php me +thod=post>"; print " <INPUT type=hidden name=login_username value=$u +sername>"; print " <INPUT type=hidden name=domain value=$domain>"; print " <INPUT type=hidden name=secretkey value=$passwo +rd>"; print " <INPUT type=hidden name=js_autodetect_results v +alue=0 >"; print " <INPUT type=hidden name=just_logged_in value=1> +"; print " <INPUT type=hidden name=activate_timeout value= +yes>"; print "</FORM>"; print "<SCRIPT language=JavaScript>"; print " document.f.submit();"; print "</SCRIPT>"; print "</BODY></HTML>"; }
Edit by tye, drop BR, add CODE, READMORE etc.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: CGI Auto Login
by jeffa (Bishop) on May 06, 2003 at 19:13 UTC | |
by cdubbs94 (Initiate) on May 06, 2003 at 19:40 UTC | |
by jeffa (Bishop) on May 06, 2003 at 19:46 UTC | |
by cdubbs94 (Initiate) on May 06, 2003 at 20:00 UTC | |
|
Re: CGI Auto Login
by The Mad Hatter (Priest) on May 06, 2003 at 19:01 UTC |