Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
now u know this condition will only allow letters digits and underscore as valid password but my problem is:WHAT SHOULD I ADD IN IT IF I WANT THE VALID PASSWORD TO B ATLEAST 5CHARACTERS LONG.#! /usr/bin/perl print"Content-Type:text/html\n\n"; read (STDIN,$buffer,$ENV{'CONTENT_LENGTH'});#as i'm using the #post me +thod in my form @pairs=split(/&/,$buffer); foreach $pair(@pairs) { ($name,$value) = split(/=/,$pair); $value =~ tr/+/ /; $value=~s/%[a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $FORM{$name}=$value; } #more part of program #checking password if ($FORM{'password'}=~ /^\w+$/){sucess();}else{error();}
my other problem is that i can give the login only if there exists alinux account with the same username.since i'm working in a unix enviornment so i'm simply using the YPCAT command as follows
now this usually works by giving the name of a user directly but here using it indirectly it is giving me error:"not enough arguments for grep at ....near})" how can i get around this errorif ii HAVE TOuse this ypcat thanksif (ypcat passwd |grep $FORM('username'}){check();}else {error();}
update (broquaint): title change (was problem of a beginner)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing and verifying login for a CGI form
by Abigail-II (Bishop) on Jul 09, 2003 at 07:11 UTC | |
|
Re: Parsing and verifying login for a CGI form
by antirice (Priest) on Jul 09, 2003 at 07:13 UTC | |
by Anonymous Monk on Jul 09, 2003 at 09:42 UTC | |
by antirice (Priest) on Jul 09, 2003 at 09:49 UTC |