Cgi mail formular
Hej folkens.Jeg har haft mange problemer med en mail formular og det endte så med at jeg skiftede Webhost.
Desværre hjalp det ikke at skifte webhost og den virker stadig ikke!
Jeg håber I kan hjælpe mig, hvad kan jeg ha' gjort forkert?
*****Mail formularen*****
http://dagens6.dk/Kontakt.html
*****Html koden*****
<form action="/cgi-bin/form_mailer.cgi" method="post">
<p>Din Email:<br>
<input type="text" name="email_address" size="40"></p>
<p>Din Besked:<br>
<textarea name="comments" cols="50" rows="10"></textarea>
<p><input type="submit" name="send" value="Send Email"></p>
</form>
*****form_mailer.cgi*****
#!/usr/sbin/sendmail
use CGI;
# Create the CGI object
my $query = new CGI;
# Output the HTTP header
print $query->header ( );
# Capture the form results
my $email_address = $query->param("email_address");
my $comments = $query->param("comments");
# Filter the form results
$email_address = filter_header_field ( $email_address );
$comments = filter_field ( $comments );
# Email the form results
open ( MAIL, "| /usr/sbin/sendmail -t" );
print MAIL "From: $email_address\n";
print MAIL "To: minemail@ekspert.dk\n";
print MAIL "Subject: Form Submission\n\n";
print MAIL "$comments\n";
print MAIL "\n.\n";
close ( MAIL );
# Thank the user
print <<END_HTML;
<html>
<head></head>
<body>Tak for din henvendelse</body>
</html>
END_HTML
# Functions for filtering user input
sub filter_field
{
my $field = shift;
$field =~ s/From://gi;
$field =~ s/To://gi;
$field =~ s/BCC://gi;
$field =~ s/CC://gi;
$field =~ s/Subject://gi;
$field =~ s/Content-Type://gi;
return $field;
}
sub filter_header_field
{
my $field = shift;
$field =~ s/From://gi;
$field =~ s/To://gi;
$field =~ s/BCC://gi;
$field =~ s/CC://gi;
$field =~ s/Subject://gi;
$field =~ s/Content-Type://gi;
$field =~ s/[\0\n\r\|\!\/\<\>\^\$\%\*\&]+/ /g;
return $field;
}