ggordon
Programmer
- Sep 15, 2003
- 45
Weird problem (for me).
Here's the script I am running.
==============================
#!/usr/bin/perl
$mailprog = '/usr/lib/sendmail';
$recipient = 'test@test1.com';
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
open (MAIL, "|$mailprog $recipient");
print MAIL "To: $recipient\n";
print MAIL "From: $FORM{'Email_Address'}\n";
print MAIL "Subject: Bishop Kelley Online Form\n\n";
foreach $pair(@pairs)
{
($name,$value)=split(/=/,$pair);
$value=~ tr/+/ /;
$name=~ tr/+/ /;
$value=~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$name=~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$FORM{$name}=$value;
print MAIL "$name:\t $value\n\n";
}
close(MAIL);
print "Location:
============================
I set permissions on the Linux server to 755.
It is working fine when I run it from a server (garymgordon.com), but when I try to run it from a Linux server on (bkelleyhs.org), I get an internal server error.
The code is identical.
Permissions are the same.
Uploaded the script using FTP in Ascii mode.
I don't understand what could cause this to occur.
I would greatly appreciate some thoughts. Maybe I am missing something stupid.
Help????
Gary
Gary M. Gordon
Here's the script I am running.
==============================
#!/usr/bin/perl
$mailprog = '/usr/lib/sendmail';
$recipient = 'test@test1.com';
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
open (MAIL, "|$mailprog $recipient");
print MAIL "To: $recipient\n";
print MAIL "From: $FORM{'Email_Address'}\n";
print MAIL "Subject: Bishop Kelley Online Form\n\n";
foreach $pair(@pairs)
{
($name,$value)=split(/=/,$pair);
$value=~ tr/+/ /;
$name=~ tr/+/ /;
$value=~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$name=~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$FORM{$name}=$value;
print MAIL "$name:\t $value\n\n";
}
close(MAIL);
print "Location:
============================
I set permissions on the Linux server to 755.
It is working fine when I run it from a server (garymgordon.com), but when I try to run it from a Linux server on (bkelleyhs.org), I get an internal server error.
The code is identical.
Permissions are the same.
Uploaded the script using FTP in Ascii mode.
I don't understand what could cause this to occur.
I would greatly appreciate some thoughts. Maybe I am missing something stupid.
Help????
Gary
Gary M. Gordon