Im having trouble editing this cgi contact form, when i submit this errors shows on the next page
"CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers."
any ideas?
heres the coding to send the email
- Code: Select all
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
print "Content-type: text/html \n\n";
print "hello world";
# Website Contact Form Generator
# http://www.tele-pro.co.uk/scripts/contact_form/
# This script is free to use as long as you
# retain the credit link
# get posted data into local variables
$input = new CGI;
$EmailFrom = $input->param('EmailFrom');
$EmailTo = "dxxxxxxxx\@xxxxxxxx.com";
$Subject = "Win a Xmas Hamper";
$name = $input->param('name');
$email = $input->param('email');
$telephone = $input->param('telephone');
$company = $input->param('company');
$address1 = $input->param('address1');
$address2 = $input->param('address2');
$address3 = $input->param('address3');
$postcode = $input->param('postcode');
# validation
$validationOK='true';
if ($EmailFrom eq '') {$validationOK='false';}
if ($validationOK eq 'false') {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
# prepare email body text
$Body = "Xmas Competition - Colour Change:";
$Body .= "\n";
$Body .= "\n";
$Body .= "Their Name: ";
$Body .= "$name";
$Body .= "\n";.
$Body .= "Their Email: ";
$Body .= "$email";
$Body .= "\n";
$Body .= "Their telephone number: ";
$Body .= "$telephone";
$Body .= "\n";
$Body .= "Their Company: ";
$Body .= "$company";
$Body .= "Their Address: ";
$Body .= "$address1";
$Body .= "$address2";
$Body .= "$address3";
$Body .= "$postcode";
# send email
use Win32::OLE;
$ex = Win32::OLE->new('CDONTS.NewMail') or die "\nCDONTS error";
$ex->Send($EmailFrom,$EmailTo,$Subject,$Body);
# redirect to success page
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.html\">";
cheers


