contact-form to download pdf and send emails
Posted: Tue Mar 15, 2011 5:44 pm
Hello,
I need assistance regarding some code that i am working on. Maybe someone can help me?
here is the code:
here is the php file
====================================================================
<?php
$to = 'email<at>address1.com' . ', ';
$to .= 'emai<at>address2.com';
$from = $_POST['Email'] ;
$name = $_POST['Name'] ;
$companyname = $_POST['Company'] ;
$headers = "From: $from";
$subject = "Brochure Form Data";
$message = "Thank you for submitting a completed form! The form was submitted to $to!";
$output = header("Location:http://...../FIDIC-ch...
$fields = array();
$fields{"Name"} = "Name";
$fields{"Company"} = "Company";
$fields{"Email"} = "Email";
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_POST[$a]); }
$headers2 = "From: email<at>address3.com";
$subject2 = "Thank you for contacting us";
$autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usualy within 48 hours. If you have any more questions, please consult our website at url";
if($from == '') {echo "You have not entered an email, please go back and enter an email address";}
else {
if($name == '') {echo "You have not entered a name, please go back and enter a name";}
if($companyname == '') {echo "You have not entered a company name, please go back and enter a company name.";}
else {
echo "Thank you for submitting a completed form! The form was submitted to $to!";
$send = mail($to, $subject, $body, $headers, $message);
$send2 = mail($from, $subject2, $autoreply, $headers2);}
if($send)
{header("Location:http://..../FIDIC-chr...
else
{echo "We encountered an error sending your mail, please notify webmaster<at>YourCompany.com"; }
}
?>
===============================================================
what i need assistance on is how to make the page load with the message: "Thank you for submitting a completed form! The form was submitted to $to!"
while the page loads as i click the submit button from the contact form, the pdf file opens up and the thank you greeting is not found....
Please help...URGENT!
Thanks,
A. Tirona
I need assistance regarding some code that i am working on. Maybe someone can help me?
here is the code:
here is the php file
====================================================================
<?php
$to = 'email<at>address1.com' . ', ';
$to .= 'emai<at>address2.com';
$from = $_POST['Email'] ;
$name = $_POST['Name'] ;
$companyname = $_POST['Company'] ;
$headers = "From: $from";
$subject = "Brochure Form Data";
$message = "Thank you for submitting a completed form! The form was submitted to $to!";
$output = header("Location:http://...../FIDIC-ch...
$fields = array();
$fields{"Name"} = "Name";
$fields{"Company"} = "Company";
$fields{"Email"} = "Email";
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_POST[$a]); }
$headers2 = "From: email<at>address3.com";
$subject2 = "Thank you for contacting us";
$autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usualy within 48 hours. If you have any more questions, please consult our website at url";
if($from == '') {echo "You have not entered an email, please go back and enter an email address";}
else {
if($name == '') {echo "You have not entered a name, please go back and enter a name";}
if($companyname == '') {echo "You have not entered a company name, please go back and enter a company name.";}
else {
echo "Thank you for submitting a completed form! The form was submitted to $to!";
$send = mail($to, $subject, $body, $headers, $message);
$send2 = mail($from, $subject2, $autoreply, $headers2);}
if($send)
{header("Location:http://..../FIDIC-chr...
else
{echo "We encountered an error sending your mail, please notify webmaster<at>YourCompany.com"; }
}
?>
===============================================================
what i need assistance on is how to make the page load with the message: "Thank you for submitting a completed form! The form was submitted to $to!"
while the page loads as i click the submit button from the contact form, the pdf file opens up and the thank you greeting is not found....
Please help...URGENT!
Thanks,
A. Tirona