Jump to content

headers question


ktstowell

Recommended Posts

Hey there!

Can anyone tell me why when i add the header redirect on the  top of my script my form no longer send the form data via email?

 

<?php

header ('Location: http://www.blueleafss.com/contact/thanks.html');

exit ();

 

  if (isset($_POST['Sumbit'])) {

    echo '<h1>Thank you for contacting Blue Leaf Systems and Support!</h1>';

}else{

 

$fname = $_POST['fname'];

$lname = $_POST['lname'];

$email = $_POST['email'];

$phone = $_POST['phone'];

$slocation = $_POST['slocation'];

$clocation = $_POST['clocation'];

$comments = $_POST['comments'];

 

$text = '';

foreach ($_POST as $name => $value) {

  if (is_array($value)) {

    $text .= sprintf("%s: %s\n", $name, join('', $value));

} else {

  $text .= sprintf("%s: %s\n", $name, $value);

}

}

$headers = 'From: ' . $_GET['from'] . "\r\n" .

mail('myemail@mysite.com', 'Form data', $text);

}

?>

 

any and all help would be uber appreciated!

 

thank you!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.