i also saw that there is a folder in my directory called cgi-bin, do i have tu put it there?
Quote
#!/usr/bin/perl
$recipient = "me@somemail.com"; # watch out for backslash
$mail = "/usr/sbin/sendmail";
if($ENV{REQUEST_METHOD} eq 'POST')
{ read STDIN, $buffer, $ENV{CONTENT_LENGTH};
}
else
{ $buffer = $ENV{QUERY_STRING};
}
foreach $pair (split /&/, $buffer)
{ ($key, $value) = split /=/, $pair, 2;
$value =~tr/+/ /;
$value =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/eg;
$FORM{$key} = $value;
}
## special treatment for the comments field
$FORM{comments} =~s/rn?/n/sg;
## here comes your form
open MAIL, "|$mail $recipient";
print MAIL <<END;
From: webserver@yoursite.com
Subject: Contact Form
Contact form filled by
$FORM{name}
$FORM{address}
phone: $FORM{phone}
fax: $FORM{fax}
Comments: $FORM{comments}
END
if(!close MAIL) {
print "(anti-spam-content-type:) text/htmlnn";
print "status=fail&error=Your+mail+could+not+be+sent";
}
else
{ print "(anti-spam-content-type:) text/htmlnn";
print "status=ok";
}
$recipient = "me@somemail.com"; # watch out for backslash
$mail = "/usr/sbin/sendmail";
if($ENV{REQUEST_METHOD} eq 'POST')
{ read STDIN, $buffer, $ENV{CONTENT_LENGTH};
}
else
{ $buffer = $ENV{QUERY_STRING};
}
foreach $pair (split /&/, $buffer)
{ ($key, $value) = split /=/, $pair, 2;
$value =~tr/+/ /;
$value =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/eg;
$FORM{$key} = $value;
}
## special treatment for the comments field
$FORM{comments} =~s/rn?/n/sg;
## here comes your form
open MAIL, "|$mail $recipient";
print MAIL <<END;
From: webserver@yoursite.com
Subject: Contact Form
Contact form filled by
$FORM{name}
$FORM{address}
phone: $FORM{phone}
fax: $FORM{fax}
Comments: $FORM{comments}
END
if(!close MAIL) {
print "(anti-spam-content-type:) text/htmlnn";
print "status=fail&error=Your+mail+could+not+be+sent";
}
else
{ print "(anti-spam-content-type:) text/htmlnn";
print "status=ok";
}















