From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Perl Perl
Sent: 17 March 2009 14:47
To: perl-win32-users@listserv.activestate.com
Subject: Perl Login Script using CGI module

> Hi All,
>  
> I am trying to create the CGI login script which has to take
parameters like username and password ( username : > ip address,
password: *****).
> And displays the page. Here I have to use CGI module with textfield.
> To be honest I have not tried much on this, but simply I have embedded
a snippet of code from CGI module link 
> as below.

You certainly seem to have missed quite a lot.

>  
> 
> #!/usr/local/bin/perl -w

"use strict; use warnings" missing. You should always use it

> 
> use CGI ':standard';

Add "use CGI::Carp qw{fatalsToBrowser};" here. It will help with
debugging.

> 
> $query = new CGI;

This is pointless, as you don't use this object.

You don't start the html document, for example:
print header();
print start_html("Test Form");

You don't start the form for the text fields to be part of, for example:
print start_form;
 
> print textfield(-name=>'field_name',
>                     -value=>'starting value',
>                     -size=>50,
>                     -maxlength=>80);
> 
> 
> print password_field(-name=>'secret',
>                                 -value=>'starting value',
>                                 -size=>50,
>                                 -maxlength=>80);

You have no action button, for example:
print submit('Action', 'Logon');

You also need to finish what you started, for example:
print end_form;
print end_html();

> 
> 
>  
> 
> It will be great if someone help to write the script. 

You need to do some more reading. Start with 'perldoc CGI'. Possibly
check out some examples, but be careful as there are a lot of bad
examples out there. I would suggest taking a look at
http://nms-cgi.sourceforge.net/ though for some decent examples.

-- 
Brian Raven 

-----------------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to