Redirect submission form, need help.
Moderator: General Moderators
-
WithHisStripes
- Forum Contributor
- Posts: 131
- Joined: Tue Sep 13, 2005 7:48 pm
Redirect submission form, need help.
Heya,
I have a submission for that I need to have redirected to a thank you page but my code isn't working. Can anyone tell me how I can do it? Thanks
-Spence
I have a submission for that I need to have redirected to a thank you page but my code isn't working. Can anyone tell me how I can do it? Thanks
-Spence
-
WithHisStripes
- Forum Contributor
- Posts: 131
- Joined: Tue Sep 13, 2005 7:48 pm
Code: Select all
$msg="Email to send notification to: " . $_POST['email'] . "\n";
$headers="From: " . $_POST['email']. "\n";
mail('spencer@firstcause.org', "Notify me when the site is complete!", $msg, $headers);after the mail() call, add
The exit; call is very important. 
Code: Select all
header('Location: http://www.firstcause.org/thankyou.php');
exit;-
WithHisStripes
- Forum Contributor
- Posts: 131
- Joined: Tue Sep 13, 2005 7:48 pm
That didn't seem to work. I got this message:
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/firstcau/public_html/maintenance/process.php:9) in /usr/home/firstcau/public_html/maintenance/process.php on line 17
Here is my new code with your snippet in there:
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/firstcau/public_html/maintenance/process.php:9) in /usr/home/firstcau/public_html/maintenance/process.php on line 17
Here is my new code with your snippet in there:
Code: Select all
$msg="Email to send notification to: " . $_POST['email'] . "\n";
$headers="From: " . $_POST['email']. "\n";
mail('spencer@firstcause.org', "Notify me when the site is complete!", $msg, $headers);
header('Location: http://www.firstcause.org/maintenance/s ... ssful.htm');
exit;-
WithHisStripes
- Forum Contributor
- Posts: 131
- Joined: Tue Sep 13, 2005 7:48 pm
-
WithHisStripes
- Forum Contributor
- Posts: 131
- Joined: Tue Sep 13, 2005 7:48 pm
Okay, I guess I just don't understand what echo'd is. Because here is my exact code:
So what am I overlooking?
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>process</title>
</head>
<body>
<?php
header('Location: http://www.google.com');
exit;
$msg="Email to send notification to: " . $_POST['email'] . "\n";
$headers="From: " . $_POST['email']. "\n";
mail('spencer@firstcause.org', "Notify me when the site is complete!", $msg, $headers);
?>
</body>
</html>- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>process</title>
</head>
<body>-
WithHisStripes
- Forum Contributor
- Posts: 131
- Joined: Tue Sep 13, 2005 7:48 pm
Thanks SO much guys, I really appreciate the help. You were right, I had to take out anything that wasn't within the tags. You guys are lifesavers!
Code: Select all
<?php ?>