CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Simple Password Script



Apr 16, 2001, 7:44 AM

Post #1 of 2 (356 views)
Simple Password Script Can't Post

Ok, I am a complete Perl newbie, and I need some help.

I want to write a quick script that will take some input from a text box in an HTML form (password) and pass it to the script, which will check it against the password I've set in the script, and if correct, redirect the person to one page, and if incorrect, ask them to login again.

I don't need to have any encryption or anything, as the site I'm going to use this on is NOT visited by anyone computer savvy.

If anyone can help, or point me to an existing script that does this, I will be eternally greatful. I know there are a couple of scripts around that will generate the login page, but I don't want to do that.



Apr 17, 2001, 1:12 PM

Post #2 of 2 (331 views)
Re: Simple Password Script [In reply to] Can't Post

alright, well, assuming that your names for the fields on your html page is "user" and "pass" your perl script would look something like this

use CGI qw(:standard);
print "Content-type:text/html\n\n";

$user = param('user');
$pass= param('pass');

if (($user eq "username") && ($pass eq "password")){
&do stuff;}
else { &do other stuff;}

the &do stuff and &do other stuff are your sub routines

visit my web site at <a href=>here</a>


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives