Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $from = $_REQUEST['Email'];
- $name = $_REQUEST['Name'];
- $headers = "From: $from";
- $subject = "YPW Contact Form";
- $fields = array();
- $fields{"Name"} = "Name";
- $fields{"Company"} = "Company";
- $fields{"Email"} = "Email";
- $fields{"Phone"} = "Phone";
- $fields{"Message"} = "Message";
- $body = "We have received the following information:\n\n";
- foreach ($fields as $a => $b)
- {
- $body .= sprintf("%20s: %s\n", $b, $_REQUEST[$a]);
- }
- $subject2 = "Thank you for contacting us";
- $autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible. If you have any more questions, please consult our website at www.yardleypressurewash.com";
- if ($from == '')
- {
- print "You have not entered an email, please go back and try again";
- }
- else
- {
- if ($name == '')
- {
- print "You have not entered a name, please go back and try again";
- }
- else
- {
- $send = mail($to, $subject, $body, $headers);
- $send2 = mail($from, $subject2, $autoreply, $headers2);
- if ($send)
- {
- header("Location: http://www.yardleypressurewash.com/thankyou.html");
- }
- else
- {
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement