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('[email protected]', 'Form data', $text);

}

?>

 

any and all help would be uber appreciated!

 

thank you!

Link to comment
https://forums.phpfreaks.com/topic/129048-headers-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.