Hi Brian,
        Thanks a lot for your kind mail and in detail description.
Please find the the code I have written as per your suggestion, but while
running I got the error which is pasted after code.

#!/usr/bin/perl -w
use CGI ':standard';

use CGI::Carp qw{fatalsToBrowser};

$q = new CGI;
print $q->header(),
$q->start_html(-title=>'Login Window!'),
      $q->h1('Login Window!'),

print $q->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);

print submit();
print $q->end_form();
print $q->end_html;
Error message as below.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, webmas...@company.com and inform
them of the time the error occurred, and anything you might have done that
may have caused the error.

More information about this error may be available in the server error log.

P.S: I agree that i didn't used the strict here.





On 3/17/09, Brian Raven <bra...@nyx.com> wrote:

>
> 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
>



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

Reply via email to