hopefulcd has asked for the wisdom of the Perl Monks concerning the following question:
The tests that I've run through include checking the file permissions and setting them to 0755, carefully checking the spelling in the files, checking the html form, and I also ran a slightly modified version of this code from the command line successfully. The annoying Internal Server error that is in the Apache error log is as follows: Mon Jun 16 17:56:46 2008 error client 76.193.171.114 File does not exist: /home/hopefulc/public_html/500.shtml The error seems very simple, except that I know the file does exist. If anyone has any suggestions to help it would be very much appreciated...#!/usr/bin/perl -wT use CGI; use CGI::Cookie; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use Fcntl qw(:flock :seek); use Fcntl; use strict; my ( $name, #username they type in $pass, #password they type in $sys_name, #username in the member file $sys_pass, #password in the member file @members, #array of all members $dirto_members_list, #directory to members file $valid_name, #variable to determine name validity $valid_pass, #variable to determine password validity $cookie #cookie used to dtermine if they're log +ged in or not ); $name = param('username'); $pass = param('password'); print header; print start_html('Login Status'); ###################################################################### +### # Check the name & password in the members file ###################################################################### +### $dirto_members_list = "/home/hopefulc/public_html/cgi-bin/koh_members_ +list.cgi"; open (MEM, $dirto_members_list) || die("The File could not be opened!" +); #open the members file flock (MEM, LOCK_SH); seek (MEM, 0, SEEK_SET); @members = <MEM>; chomp (@members); close(MEM); + #close the members file $valid_name = 0; $valid_pass = 0; foreach my $mem (@members) { ($sys_name, $sys_pass) = split (/\|..\|/, $mem); if ($name eq $sys_name) { $valid_name = 1; if ($pass eq $sys_pass) { $valid_pass = 1; print "Congratulations $name, you logged in!\n<br><br>\n"; } else { print "Sorry, you didn't type in the correct password.\n<b +r><br>\n"; } } } ###################################################################### +#### print end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl CGI Apache help...
by marto (Cardinal) on Jun 18, 2008 at 11:32 UTC | |
|
Re: Perl CGI Apache help...
by psini (Deacon) on Jun 18, 2008 at 11:32 UTC | |
|
Re: Perl CGI Apache help...
by hopefulcd (Initiate) on Jun 18, 2008 at 23:38 UTC | |
by Anonymous Monk on Jun 19, 2008 at 04:27 UTC | |
|
Re: Perl CGI Apache help...
by Anonymous Monk on Jun 18, 2008 at 11:40 UTC | |
|
Re: Perl CGI Apache help...
by throop (Chaplain) on Jun 18, 2008 at 15:03 UTC |