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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Simple Password Script

 



jasonepowell
Deleted

Apr 16, 2001, 7:44 AM

Post #1 of 2 (362 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.

Thanks!



ultimategamer2k
User

Apr 17, 2001, 1:12 PM

Post #2 of 2 (337 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

#!/usr/bin/perl
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=http://ultimategamer.cjb.net>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