
ningji
User
Nov 26, 2012, 12:45 PM
Post #1 of 2
(2521 views)
|
HTTP 500 Internal Server Error from my login page
|
Can't Post
|
|
Hi guys, another cgi question if some one can help. i find 2 files for login webpage using perl cgi.pm, after i give the user name and password, click login, i get this, HTTP 500 Internal Server Error Any help appreciated. following is the login.pl, don't think index1.pl is needed here. #!/usr/bin/perl # login.pl use CGI; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; use CGI::Session ( '-ip_match' ); my $q = new CGI; my $usr = $q->param('usr'); my $pwd = $q->param('pwd'); if($usr ne '') { # process the form if($usr eq "demo" and $pwd eq "demo") { $session = new CGI::Session(); print $session->header(-location=>'index1.pl'); } else { print $q->header(-type=>"text/html",-location=>"login.pl"); } } elsif($q->param('action') eq 'logout') { $session = CGI::Session->load() or die CGI::Session->errstr; $session->delete(); print $session->header(-location=>'login.pl'); } else { print $q->header; print $q->start_html; print $q->start_form(-name=>'myLogin', -method=>'GET'); # print $q->start_form(-name=>'myLogin', -method=>'POST'); print $q->h4("username"); print $q->textfield(-name=>'usr'); print $q->h4("password"); print $q->textfield(-name=>'pwd'); print $q->submit(-name=>'login'); print $q->end_form; print $q->end_html; }
(This post was edited by ningji on Nov 26, 2012, 12:46 PM)
|