Ekanvitha9 has asked for the wisdom of the Perl Monks concerning the following question:
Hi,I have crated a registration form in HTML and calling the arrugemts in Perl script.I'm running this code in IIS server.This is my HTML code
<!DOCTYPE html> <html> <H3>Registration Form </H3> <body> <form name="myform" METHOD="POST" ACTION="app.pl" > <p> <label for="employee name">Employee Name</label> <input type="text" id="employee name" name="employee n +ame"/><br> </p> <p> <label for="password">Password </label> <input type="password" id="password" name="password" r +equired/> </p> <p> <label for="dob">DOB </label> <input type="date" id="dob" name="dob" required /> </p> <p> <label for="Gender">Gender</label> <input type="radio" id="gender" name="gender" value="m +ale" required /> Male <input type="radio" id="gender" name="gender" value="f +emale" required/> Female <input type="radio" id="gender" name="gender" value="o +ther" required/> Other </p> <p> <label for="phone number">Phone number</label> <input type="tel" id="Phonenumber" name="Phonenumber" +required/> </p> <p> <label for="emailid">EmailId</label> <input type="email" id="emailid" name="emailid" /> </p> </form> </body> </html>
This is the perl script
#!usr/bin/perl use strict; use warnings; use CGI qw(:standard); print "content-type:text/plain\n\n"; my $query = CGI->new(); my $employee=$query->param("employee name"); print("$employee\n"); my $password = $query->param("password"); print ("$password\n"); if ($password != /^[\w\d@#\$%`~!^&*()_\-+={}[\]|\\'";:\/?.><,]{8}$/ ) { print("please enter correct password\n"); } my $Phonenumber = $query->param(Phonenumber); my@ph=split('',$Phonenumber); my $size=@ph; if($size==11 ){ if($Phonenumber=!/^[6-9]+\d/) { print("Please enter valid phone number"); } } my $emailid = $query->param("emailid"); print ("$emailid");
While entering the password and submitting,I'm unable to validate.Please tell me where I'm doing wrong.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: validations in perl
by Corion (Patriarch) on Jul 16, 2019 at 15:15 UTC | |
by Ekanvitha9 (Novice) on Jul 17, 2019 at 10:52 UTC | |
by Corion (Patriarch) on Jul 17, 2019 at 11:00 UTC | |
|
Re: validations in perl
by choroba (Cardinal) on Jul 16, 2019 at 15:13 UTC | |
|
Re: validations in perl
by davido (Cardinal) on Jul 17, 2019 at 14:53 UTC | |
|
Re: validations in perl
by Don Coyote (Hermit) on Jul 17, 2019 at 14:03 UTC | |
by haukex (Archbishop) on Jul 17, 2019 at 17:09 UTC | |
|
Re: validations in perl
by karlgoethebier (Abbot) on Jul 18, 2019 at 15:20 UTC | |
|
Re: validations in perl
by Don Coyote (Hermit) on Jul 30, 2019 at 08:25 UTC | |
|
Re: validations in perl
by Anonymous Monk on Jul 18, 2019 at 01:57 UTC |