/    Sign up×
Community /Pin to ProfileBookmark

redirect page once mail() is sent.

below you will find code that echos an html message that on submit sends the same html message to the email address from the form. what I need to know is how to redirect the page to [url]http://www.bloomingcanvas.com/mike/thankyou.html[/url] once the mail() is sent

[CODE]
<?

$to = $_POST[‘guestemail’];
$from = $_POST[‘usersemail’];
$name = $_POST[‘guestname’];
$sendername = $_POST[‘usersname’];
$message = $_POST[‘themessage’];
$subject = “$name Please join us at the next FX”;

$emailmessage = <<<EOF
<html>
<body bgcolor=”white”>

<table align=”center” border=”1″ bordercolor=”gray” width=”400px”>
<tr>
<td width=”400px” align=”center”>
<img src=”http://www.bloomingcanvas.com/mike/title.gif”/><br/>
</td>
</tr>

<tr>
<td>
<font style=”font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt”>Dear $name</font><br/><br/>
<font style=”font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt”>On January 5th, we would like to invite you to the next FX. FX stands for Family Experience. During the FX program… <br/><br/>$message <br/><br/> January 5th at 5:30 PM Do not be late, the start of the show is always action packed!</font> <br/><br/>
<font style=”font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt”> <br/> $sendername </font><br/><br/>
<font style=”font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt”> Click here for directions<a href=”http://www.mapquest.com/maps/map.adp?address=7689%20Bethany%20Rd&city=Liberty%20Township&state=OH&zipcode=45044%2d9515&country=US&title=%3cb%20class%3d%22fn%20org%22%3e7689%20Bethany%20Rd%3c%2fb%3e%3cbr%20%2f%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22locality%22%3eLiberty%20Township%3c%2fspan%3e%2c%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22region%22%3eOH%3c%2fspan%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22postal%2dcode%22%3e45044%2d9515%3c%2fspan%3e%2c%20%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22country%2dname%22%3eUS%3c%2fspan%3e%3c%2fspan%3e&cid=lfmaplink2&name=&dtype=s”>Map of 7689 Bethany Rd Liberty Township, OH 45044-9515, US</a>
</td>
</tr
</table>
</body>
</html>
EOF;

$success_sent_msg = <<<EOF
<html>
<body bgcolor=”white”>

<table align=”center” border=”1″ bordercolor=”gray” width=”400px”>
<tr>
<td width=”400px” align=”center”>
<font style=”font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt”>Please Review your message and click Send below to send your email</font>
<img src=”http://www.bloomingcanvas.com/mike/title.gif”/><br/>
</td>
</tr>

<tr>
<td width=”400″>
<font style=”font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt”>Dear $name</font><br/><br/>
<font style=”font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt”>On January 5th, we would like to invite you to the next FX. FX stands for Family Experience. During the FX program… <br/><br/>$message <br/><br/> January 5th at 5:30 PM Do not be late, the start of the show is always action packed!</font> <br/><br/>
<font style=”font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt”> <br/> $sendername </font><br/><br/>
<font style=”font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt”> Click here for directions<a href=”http://www.mapquest.com/maps/map.adp?address=7689%20Bethany%20Rd&city=Liberty%20Township&state=OH&zipcode=45044%2d9515&country=US&title=%3cb%20class%3d%22fn%20org%22%3e7689%20Bethany%20Rd%3c%2fb%3e%3cbr%20%2f%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22locality%22%3eLiberty%20Township%3c%2fspan%3e%2c%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22region%22%3eOH%3c%2fspan%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22postal%2dcode%22%3e45044%2d9515%3c%2fspan%3e%2c%20%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22country%2dname%22%3eUS%3c%2fspan%3e%3c%2fspan%3e&cid=lfmaplink2&name=&dtype=s”>Map of 7689 Bethany Rd Liberty Township, OH 45044-9515, US</a>
</td>
</tr>
<tr>
<td><a href=”#” onClick=”history.go(-1)”>Click Here</a><font style=”font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt”>to make changes</Font><form action=”test5.php” method=”post”><input type=”hidden” name=”guestemail” value=”{$to}” /><input type=”hidden” name=”usersemail” value=”{$from}” /><input type=”hidden” name=”guestname” value=”{$name}” /><input type=”hidden” name=”usersname” value=”{$sendername}” /><input type=”hidden” name=”themessage” value=”{$message}” /><input type=”submit” name=”sendmail” value=”Send Email” /></form>
</td>
</tr>

</table>
</body>
</html>
EOF;

echo $success_sent_msg;

$headers = “From: $fromrn”;
$headers .= “Content-type: text/htmlrn”;
$to = “$to, $from”; // this will send to both emails at the same time.
// now lets send the email.

if(isset($_POST[“sendmail”]))
mail($to, $subject, $emailmessage, $headers);

?>[/CODE]

to post a comment
PHP

13 Comments(s)

Copy linkTweet thisAlerts:
@SyCoDec 28.2007 — If you want to redirect immediately after the send you can use php header location.

add

header('Location: http://www.bloomingcanvas.com/mike/thankyou.html');

after mail();
Copy linkTweet thisAlerts:
@DenoteoneauthorDec 28.2007 — this is the error message I am getting.

Warning: Cannot modify header information - headers already sent by (output started at /home/www/bloomingcanvas/mike/test5.php:1) in /home/www/bloomingcanvas/mike/test5.php on line 83
Copy linkTweet thisAlerts:
@SyCoDec 28.2007 — As the error sugests your outputting something to the page before the header.

If you want to display a message for a few seconds, then redirect you have to use a meta refresh or javascript.
&lt;meta http-equiv="refresh" content="3;url=http://www.bloomingcanvas.com/mike/thankyou.html"&gt;
Copy linkTweet thisAlerts:
@DenoteoneauthorDec 28.2007 — so would it look something like this? I am still getting an error message. though


[CODE]
if(isset($_POST["sendmail"])) {
mail($to, $subject, $emailmessage, $headers);

echo "<meta http-equiv="refresh" content="3;url=http://www.bloomingcanvas.com/mike/thankyou.html">;
}
[/CODE]
Copy linkTweet thisAlerts:
@holidayDec 28.2007 — This error is caused by trying to send out headers after you have already sent content to the browser.

this code will result in an error do to the fact that there is html before the php tags. if you want to send a header, make sure that "<?php" is at the very top of the page, and don't echo anything before the header is sent!
[code=php]
HTML CODE or ever just a new line before the php tags, this will cause an error
<?php
header("Location: http://www.someurl.com");
?>
[/code]


this code will also result in an error, do to the fact that we have echoed something before the header:
[code=php]
<?php
echo "hello world";

header("Location: http://www.someurl.com");
?>
[/code]
Copy linkTweet thisAlerts:
@SyCoDec 28.2007 — A meta refresh goes in the head tags after the message is sent.

[code=php]<head>
<?
if(isset($_POST["sendmail"])) {
echo "<meta http-equiv="refresh" content="3;url=http://www.bloomingcanvas.com/mike/thankyou.html">;
}
?>
</head>[/code]


content="3 is 3 seconds you can set that to any number
Copy linkTweet thisAlerts:
@DenoteoneauthorDec 28.2007 — I ahve changed my code to the follow the most important part is the $success_sent_msg =

this is what is echoed to the screen and this is were the send email button show and when pressed should reshesh in 1 second to a thank you page. I have moved all of this into the

[CODE]<?

$to = $_POST['guestemail'];
$from = $_POST['usersemail'];
$name = $_POST['guestname'];
$sendername = $_POST['usersname'];
$message = $_POST['themessage'];
$subject = "$name Please join us at the next FX";





$emailmessage = <<<EOF
<html>
<body bgcolor="white">

<table align="center" border="1" bordercolor="gray" width="400px">
<tr>
<td width="400px" align="center">
<img src="http://www.bloomingcanvas.com/mike/title.gif"/><br/>
</td>
</tr>

<tr>
<td>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt">Dear $name</font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">On January 5th, we would like to invite you to the next FX. FX stands for Family Experience. During the FX program... <br/><br/>$message <br/><br/> January 5th at 5:30 PM Do not be late, the start of the show is always action packed!</font> <br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt"> <br/> $sendername </font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt"> Click here for directions<a href="http://www.mapquest.com/maps/map.adp?address=7689%20Bethany%20Rd&city=Liberty%20Township&state=OH&zipcode=45044%2d9515&country=US&title=%3cb%20class%3d%22fn%20org%22%3e7689%20Bethany%20Rd%3c%2fb%3e%3cbr%20%2f%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22locality%22%3eLiberty%20Township%3c%2fspan%3e%2c%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22region%22%3eOH%3c%2fspan%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22postal%2dcode%22%3e45044%2d9515%3c%2fspan%3e%2c%20%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22country%2dname%22%3eUS%3c%2fspan%3e%3c%2fspan%3e&cid=lfmaplink2&name=&dtype=s">Map of 7689 Bethany Rd Liberty Township, OH 45044-9515, US</a>
</td>
</tr
</table>
</body>
</html>
EOF;





$success_sent_msg = <<<EOF
<html>
<head>
<?
$headers = "From: $fromrn";
$headers .= "Content-type: text/htmlrn";
$to = "$to, $from"; // this will send to both emails at the same time.

if(isset($_POST["sendmail"])) {
mail($to, $subject, $emailmessage, $headers);
echo "<meta http-equiv="refresh" content="1;url="http://www.bloomingcanvas.com/mike/thankyou.html">;
}
?>

</head>

<body bgcolor="white">
<table align="center" border="1" bordercolor="gray" width="400px">
<tr>
<td width="400px" align="center">
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">Please Review your message and click Send below to send your email</font>
<img src="http://www.bloomingcanvas.com/mike/title.gif"/><br/>
</td>
</tr>

<tr>
<td width="400">
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt">Dear $name</font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">On January 5th, we would like to invite you to the next FX. FX stands for Family Experience. During the FX program... <br/><br/>$message <br/><br/> January 5th at 5:30 PM Do not be late, the start of the show is always action packed!</font> <br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt"> <br/> $sendername </font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt"> Click here for directions<a href="http://www.mapquest.com/maps/map.adp?address=7689%20Bethany%20Rd&city=Liberty%20Township&state=OH&zipcode=45044%2d9515&country=US&title=%3cb%20class%3d%22fn%20org%22%3e7689%20Bethany%20Rd%3c%2fb%3e%3cbr%20%2f%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22locality%22%3eLiberty%20Township%3c%2fspan%3e%2c%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22region%22%3eOH%3c%2fspan%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22postal%2dcode%22%3e45044%2d9515%3c%2fspan%3e%2c%20%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22country%2dname%22%3eUS%3c%2fspan%3e%3c%2fspan%3e&cid=lfmaplink2&name=&dtype=s">Map of 7689 Bethany Rd Liberty Township, OH 45044-9515, US</a>
</td>
</tr>
<tr>
<td><a href="#" onClick="history.go(-1)">Click Here</a><font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt">to make changes</Font><form action="test5.php" method="post"><input type="hidden" name="guestemail" value="{$to}" /><input type="hidden" name="usersemail" value="{$from}" /><input type="hidden" name="guestname" value="{$name}" /><input type="hidden" name="usersname" value="{$sendername}" /><input type="hidden" name="themessage" value="{$message}" /><input type="submit" name="sendmail" value="Send Email" /></form>
</td>
</tr>

</table>
</body>
</html>
EOF;

echo $success_sent_msg;
?>[/CODE]


i am getting this error. Parse error: parse error, expecting T_STRING' or T_VARIABLE' or `T_NUM_STRING' in /home/www/bloomingcanvas/mike/test5.php on line 50
Copy linkTweet thisAlerts:
@TJ111Dec 28.2007 — You have PHP declarations inside of a HEREDOC.
Copy linkTweet thisAlerts:
@SyCoDec 28.2007 — That's quite a different style of PHP you have there. Are you a PERL or similar programmer moving to PHP? All those EOFs!

I've had a play with your code to give you some idea of how I usually do something like this. It's snipped but should give you an idea. I'm also presuming the page that preceeds this page is posting the values stored in the hidden form elements.

Debug the usualy way, echo the posted vars to the page to make sure they exist.

[code=php]<?
echo "
<html>
<head> ";

//this conditional will send the email after the submit
if(isset($_POST["sendMYmail"])) {

$headers = "From: $fromrn";
$headers .= "Content-type: text/htmlrn";

$to = $_POST['guestemail'].",". $_POST['from']; // this will send to both emails at the same time.

//$to = $_POST['guestemail'];
$from = $_POST['usersemail'];
$name = $_POST['guestname'];
$sendername = $_POST['usersname'];
$message = $_POST['themessage'];
$subject = $_POST['name']." Please join us at the next FX";

$emailmessage = '
<html>
<body bgcolor="white">
etc';

mail($to, $subject, $emailmessage, $headers);
}

if(isset($_POST["sendmail"])) {
?>
<meta http-equiv="refresh" content="1;url="http://www.bloomingcanvas.com/mike/thankyou.html">";
</head>
<body>
Thanks for sending the mail!

<?
}else{
?>
</head>
<body bgcolor="white">
<table align="center" border="1" bordercolor="gray" width="400px">
<tr>
<td width="400px" align="center">
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">Please Review your message and click Send below to send your email</font>
<img src="http://www.bloomingcanvas.com/mike/title.gif"/><br/>
</td>
</tr>
<tr>
<td><a href="#" onClick="history.go(-1)">Click Here</a><font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt">to make changes</Font><form action="<?=$PHP_SELF?>" method="post"><input type="hidden" name="guestemail" value="<?=$_POST['to']?>" /><input type="hidden" name="usersemail" value="<?=$_POST['from']?>" /><input type="hidden" name="guestname" value="<?=$_POST['name']?>" /><input type="hidden" name="usersname" value="<?=$sendername?>" /><input type="hidden" name="themessage" value="<?=$_POST['message']?>" /><input type="submit" name="sendmail" value="Send Email" /></form>
</td>
</tr>
</table>
<?
}
?>
</body>[/code]
Copy linkTweet thisAlerts:
@DenoteoneauthorJan 03.2008 — I am so close but for some reason the variables that are sent in the email are not showing were the guest name is just says $name2 in the email.

here is my tweeked code.

[CODE]<?
echo "
<html>
<head> ";

//this conditional will send the email after the submit
if(isset($_POST["sendMYmail"])) {

$headers = "From: $fromrn";
$headers .= "Content-type: text/htmlrn";

$to = $_POST['guestemail'].",". $_POST['usersemail2']; // this will send to both emails at the same time.

//$to = $_POST['guestemail'];
$from = $_POST['usersemail2'];
$name2 = $_POST['guestname2'];
$sendername = $_POST['usersname2'];
$message = $_POST['themessage'];
$subject = $_POST['guestname2']." Please join us at the next FX";

$emailmessage = '
<html>
<body bgcolor="white">

<table align="center" border="1" bordercolor="gray" width="400px">
<tr>
<td width="400px" align="center">
<img src="http://www.bloomingcanvas.com/mike/title.gif"/><br/>
</td>
</tr>

<tr>
<td>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt">Dear $name2</font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">On January 5th, we would like to invite you to the next FX. FX stands for Family Experience. During the FX program... <br/><br/>$message <br/><br/> January 5th at 5:30 PM Do not be late, the start of the show is always action packed!</font> <br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt"> <br/> $sendername </font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt"> Click here for directions<a href="http://www.mapquest.com/maps/map.adp?address=7689%20Bethany%20Rd&city=Liberty%20Township&state=OH&zipcode=45044%2d9515&country=US&title=%3cb%20class%3d%22fn%20org%22%3e7689%20Bethany%20Rd%3c%2fb%3e%3cbr%20%2f%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22locality%22%3eLiberty%20Township%3c%2fspan%3e%2c%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22region%22%3eOH%3c%2fspan%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22postal%2dcode%22%3e45044%2d9515%3c%2fspan%3e%2c%20%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22country%2dname%22%3eUS%3c%2fspan%3e%3c%2fspan%3e&cid=lfmaplink2&name=&dtype=s">Map of 7689 Bethany Rd Liberty Township, OH 45044-9515, US</a>
</td>
</tr
</table>
</body>
</html>';

mail($to, $subject, $emailmessage, $headers);
}

if(isset($_POST["sendMYmail"])) {
?>

</head>
<body>
<b>Thanks for sending the mail!</b>

<?
}else{
?>
</head>
<body bgcolor="white">
<table align="center" border="1" bordercolor="gray" width="400px">
<tr>
<td width="400px" align="center">
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">Please Review your message and click Send below to send your email</font>
<img src="http://www.bloomingcanvas.com/mike/title.gif"/><br/>
</td>
</tr>

<tr>
<td width="400">
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt">Dear <?=$_POST['guestname']?></font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">On January 5th, we would like to invite you to the next FX. FX stands for Family Experience. During the FX program... <br/><br/><?=$_POST['themessage']?> <br/><br/> January 5th at 5:30 PM Do not be late, the start of the show is always action packed!</font> <br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt"> <br/> <?=$_POST['usersname']?> </font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt"> Click here for directions<a href="http://www.mapquest.com/maps/map.adp?address=7689%20Bethany%20Rd&city=Liberty%20Township&state=OH&zipcode=45044%2d9515&country=US&title=%3cb%20class%3d%22fn%20org%22%3e7689%20Bethany%20Rd%3c%2fb%3e%3cbr%20%2f%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22locality%22%3eLiberty%20Township%3c%2fspan%3e%2c%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22region%22%3eOH%3c%2fspan%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22postal%2dcode%22%3e45044%2d9515%3c%2fspan%3e%2c%20%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22country%2dname%22%3eUS%3c%2fspan%3e%3c%2fspan%3e&cid=lfmaplink2&name=&dtype=s">Map of 7689 Bethany Rd Liberty Township, OH 45044-9515, US</a>
</td>
</tr>
<tr>
<td><a href="#" onClick="history.go(-1)">Click Here</a><font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt">to make changes</Font><form action="<?=$PHP_SELF?>" method="post"><input type="hidden" name="guestemail" value="<?=$_POST['guestemail']?>" /><input type="hidden" name="usersemail2" value="<?=$_POST['usersemail']?>" /><input type="hidden" name="guestname2" value="<?=$_POST['guestname']?>" /><input type="hidden" name="usersname2" value="<?=$_POST['usersname']?>" /><input type="hidden" name="themessage" value="<?=$_POST['themessage']?>" /><input type="submit" name="sendMYmail" value="Send Email" /></form>
</td>
</tr>
</table>
<?
}
?>
</body>

</html>[/CODE]
Copy linkTweet thisAlerts:
@TJ111Jan 03.2008 — LONG strings like that are the right time to use Heredocs. When you use a single quote ' , it ignores any special characters in the string. You can either wrap $emailmessage in double quotes and escape all the quotes in the string, or just use a heredoc.

[code=php]
$emailmessage = <<<EndEmail
<html>
<body bgcolor="white">

<table align="center" border="1" bordercolor="gray" width="400px">
<tr>
<td width="400px" align="center">
<img src="http://www.bloomingcanvas.com/mike/title.gif"/><br/>
</td>
</tr>

<tr>
<td>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt">Dear $name2</font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">On January 5th, we would like to invite you to the next FX. FX stands for Family Experience. During the FX program... <br/><br/>$message <br/><br/> January 5th at 5:30 PM Do not be late, the start of the show is always action packed!</font> <br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt"> <br/> $sendername </font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt"> Click here for directions<a href="http://www.mapquest.com/maps/map.adp?address=7689%20Bethany%20Rd&city=Liberty%20Township&state=OH&zipcode=45044%2d9515&country=US&title=%3cb%20class%3d%22fn%20org%22%3e7689%20Bethany%20Rd%3c%2fb%3e%3cbr%20%2f%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22locality%22%3eLiberty%20Township%3c%2fspan%3e%2c%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22region%22%3eOH%3c%2fspan%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22postal%2dcode%22%3e45044%2d9515%3c%2fspan%3e%2c%20%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22country%2dname%22%3eUS%3c%2fspan%3e%3c%2fspan%3e&cid=lfmaplink2&name=&dtype=s">Map of 7689 Bethany Rd Liberty Township, OH 45044-9515, US</a>
</td>
</tr
</table>
</body>
</html>

EndEmail;
[/code]


Edit: O-H!
Copy linkTweet thisAlerts:
@DenoteoneauthorJan 03.2008 — Thanks everyone for your help with this topic!
Copy linkTweet thisAlerts:
@bradmasterxJan 03.2008 — you didn't have to lol,
[code=php]
<?

$to = $_POST['guestemail'];
$from = $_POST['usersemail'];
$name = $_POST['guestname'];
$sendername = $_POST['usersname'];
$message = $_POST['themessage'];
$subject = "$name Please join us at the next FX";





$emailmessage = <<<EOF
<html>
<body bgcolor="white">

<table align="center" border="1" bordercolor="gray" width="400px">
<tr>
<td width="400px" align="center">
<img src="http://www.bloomingcanvas.com/mike/title.gif"/><br/>
</td>
</tr>

<tr>
<td>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt">Dear $name</font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">On January 5th, we would like to invite you to the next FX. FX stands for Family Experience. During the FX program... <br/><br/>$message <br/><br/> January 5th at 5:30 PM Do not be late, the start of the show is always action packed!</font> <br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt"> <br/> $sendername </font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt"> Click here for directions<a href="http://www.mapquest.com/maps/map.adp?address=7689%20Bethany%20Rd&city=Liberty%20Township&state=OH&zipcode=45044%2d9515&country=US&title=%3cb%20class%3d%22fn%20org%22%3e7689%20Bethany%20Rd%3c%2fb%3e%3cbr%20%2f%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22locality%22%3eLiberty%20Township%3c%2fspan%3e%2c%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22region%22%3eOH%3c%2fspan%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22postal%2dcode%22%3e45044%2d9515%3c%2fspan%3e%2c%20%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22country%2dname%22%3eUS%3c%2fspan%3e%3c%2fspan%3e&cid=lfmaplink2&name=&dtype=s">Map of 7689 Bethany Rd Liberty Township, OH 45044-9515, US</a>
</td>
</tr
</table>
</body>
</html>
EOF;





$success_sent_msg = <<<EOF
<html>
<body bgcolor="white">

<table align="center" border="1" bordercolor="gray" width="400px">
<tr>
<td width="400px" align="center">
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">Please Review your message and click Send below to send your email</font>
<img src="http://www.bloomingcanvas.com/mike/title.gif"/><br/>
</td>
</tr>

<tr>
<td width="400">
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt">Dear $name</font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=12pt">On January 5th, we would like to invite you to the next FX. FX stands for Family Experience. During the FX program... <br/><br/>$message <br/><br/> January 5th at 5:30 PM Do not be late, the start of the show is always action packed!</font> <br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt"> <br/> $sendername </font><br/><br/>
<font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt"> Click here for directions<a href="http://www.mapquest.com/maps/map.adp?address=7689%20Bethany%20Rd&city=Liberty%20Township&state=OH&zipcode=45044%2d9515&country=US&title=%3cb%20class%3d%22fn%20org%22%3e7689%20Bethany%20Rd%3c%2fb%3e%3cbr%20%2f%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22locality%22%3eLiberty%20Township%3c%2fspan%3e%2c%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22region%22%3eOH%3c%2fspan%3e%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22postal%2dcode%22%3e45044%2d9515%3c%2fspan%3e%2c%20%20%3cspan%20style%3d%22display%3ainline%3bmargin%2dbottom%3a0px%3b%22%20class%3d%22country%2dname%22%3eUS%3c%2fspan%3e%3c%2fspan%3e&cid=lfmaplink2&name=&dtype=s">Map of 7689 Bethany Rd Liberty Township, OH 45044-9515, US</a>
</td>
</tr>
<tr>
<td><a href="#" onClick="history.go(-1)">Click Here</a><font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=10pt">to make changes</Font><form action="test5.php" method="post"><input type="hidden" name="guestemail" value="{$to}" /><input type="hidden" name="usersemail" value="{$from}" /><input type="hidden" name="guestname" value="{$name}" /><input type="hidden" name="usersname" value="{$sendername}" /><input type="hidden" name="themessage" value="{$message}" /><input type="submit" name="sendmail" value="Send Email" /></form>
</td>
</tr>

</table>
</body>
</html>
EOF;

echo $success_sent_msg;

$headers = "From: $fromrn";
$headers .= "Content-type: text/htmlrn";
$to = "$to, $from"; // this will send to both emails at the same time.
// now lets send the email.



if(isset($_POST["sendmail"])) {
mail($to, $subject, $emailmessage, $headers);
?>
<script language="javascript">window.location = 'your location';</script>
<?php
}
?>
[/code]
×

Success!

Help @Denoteone spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...