Jump to content

[SOLVED] how? after form proccessed, replace echo with a redirect to thankyou page?


nickb_53

Recommended Posts

After submitting a form

 

how to replace the echo with a redirect to thankyou.html page?

___________________________________________________________________________

 

<form action="process_form2.php"

  method="post" enctype="application/x-www-form-urlencoded" name="form1">

<input type='text' name='email'>

</label>

<label>

<input type="submit" name="Add" id="Add" value="Add Email">

</label>

</form>

___________________________________________________________________________

 

process_form2.php below

 

 

<?PHP

$email = $_POST['email'];

$subject = "Mailing List";

$message = $_POST['message'];

$target_address = '[email protected]';

$headers = "From: ".$email."\r\n". "X-Mailer: php";

if (mail($target_address, $subject, $message, $headers)) {

echo("Thank you for contacting us, we will get back to you as soon as we can xxx bye");

}

else{

echo("Sorry your message delivery failed. Please try back later");

die();

}

?>

 

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.