spewn
Programmer
- May 7, 2001
- 1,034
okay, here's the script (below). the form is at when the form is submitted, it returns this...
********
Premature end of script headers: /data1/hm/one-degree.com/cgi-bin/readInput.cgi
********
here is readInput.cgi
#!/usr/local/bin/perl
%postInputs = readPostInput();
$dateCommand = "date";
open (MAIL, "|/var/qmail/bin/qmail-inject -t"
|| return 0;
select (MAIL);
print << "EOF";
To: g@one-degree.com
From: $postInputs{'Contact_Email'}
Subject: $postInputs{'Organization'} Information Requested
$time
$postInputs{ 'Organization' } Information Requested
Name: $postInputs{'Contact_FullName'}
Email: $postInputs{ 'Contact_Email'}
Street Address: $postInputs{ 'Contact_StreetAddress'}
Street Address (cont.): $postInputs{ 'Contact_Address2'}
City: $postInputs{ 'Contact_City'}
State: $postInputs{ 'Contact_State'}
Zip: $postInputs{ 'Contact_ZipCode'}
Work Phone: $postInputs{ 'Contact_WorkPhone'}
Home Phone: $postInputs{ 'Contact_HomePhone'}
FAX: $postInputs{ 'Contact_FAX'}
Email: $postInputs{ 'Contact_Email'}
Comments: $postInputs{ 'comments'}
EOF
close(MAIL);
select(STDOUT);
printThankYou();
sub readPostInput(){
my (%searchField, $buffer, $pair, @pairs);
if ($ENV{'REQUEST_METHOD'} eq 'POST'){
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;
$name = =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$searchField{ $name} = $value;
}
}
return (%searchField);
}
sub printThankYou(){
print << "EOF";
Content-Type: text/html
<head>
<title>THANK YOU FOR YOUR REQUEST</title>
</head>
<body>
<table cellspacing=2 cellpadding=2 border=0 width=600>
<tr><th><br>
<center>
<font size=+3><b>Thank You $postInputs{'Contact_FullName'}</b></font>
</center><br><br>
<center><b><font size=+1><p>For submitting your information. We will get back to you shortly.</p>
</b>
</font>
<center>
</th></table>
</body>
</html>
EOF
}
Anyone see potential hazards and problem? -crispy
********
Premature end of script headers: /data1/hm/one-degree.com/cgi-bin/readInput.cgi
********
here is readInput.cgi
#!/usr/local/bin/perl
%postInputs = readPostInput();
$dateCommand = "date";
open (MAIL, "|/var/qmail/bin/qmail-inject -t"
select (MAIL);
print << "EOF";
To: g@one-degree.com
From: $postInputs{'Contact_Email'}
Subject: $postInputs{'Organization'} Information Requested
$time
$postInputs{ 'Organization' } Information Requested
Name: $postInputs{'Contact_FullName'}
Email: $postInputs{ 'Contact_Email'}
Street Address: $postInputs{ 'Contact_StreetAddress'}
Street Address (cont.): $postInputs{ 'Contact_Address2'}
City: $postInputs{ 'Contact_City'}
State: $postInputs{ 'Contact_State'}
Zip: $postInputs{ 'Contact_ZipCode'}
Work Phone: $postInputs{ 'Contact_WorkPhone'}
Home Phone: $postInputs{ 'Contact_HomePhone'}
FAX: $postInputs{ 'Contact_FAX'}
Email: $postInputs{ 'Contact_Email'}
Comments: $postInputs{ 'comments'}
EOF
close(MAIL);
select(STDOUT);
printThankYou();
sub readPostInput(){
my (%searchField, $buffer, $pair, @pairs);
if ($ENV{'REQUEST_METHOD'} eq 'POST'){
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;
$name = =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$searchField{ $name} = $value;
}
}
return (%searchField);
}
sub printThankYou(){
print << "EOF";
Content-Type: text/html
<head>
<title>THANK YOU FOR YOUR REQUEST</title>
</head>
<body>
<table cellspacing=2 cellpadding=2 border=0 width=600>
<tr><th><br>
<center>
<font size=+3><b>Thank You $postInputs{'Contact_FullName'}</b></font>
</center><br><br>
<center><b><font size=+1><p>For submitting your information. We will get back to you shortly.</p>
</b>
</font>
<center>
</th></table>
</body>
</html>
EOF
}
Anyone see potential hazards and problem? -crispy