Hi there,
I managed to make a page that I can fill some fields to send an HTML message and its working fantastic EXCEPT one thing
I can't include a variable inside the message, see my page's code:
<?
if ($HTTP_SERVER_VARS['REQUEST_METHOD'] != 'POST')
{
?>
<form method="post" action="<? echo $_SERVER[PHP_SELF] ?>">
Subject <input name="Subject"><br>
Message <textarea dir="ltr" name="Message" cols="60" rows="20"></textarea><br>
SendTo <input name="SendTo"><br>
<input type="submit">
</form>
<?
}
else
{
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859\r\n";
$headers .= "From: MyName <MyName@MyDomain.com>\r\n";
//Filter the message
$Message = str_replace(chr(34) , "", $HTTP_POST_VARS[Message]);
$Message = str_replace(chr(92) , "", $Message);
$Code = "ABCD1234";
//Send Emails
$MailValue = @mail($HTTP_POST_VARS[SendTo],$HTTP_POST_VARS[Subject],$Message,$headers);
echo "[$MailValue]";
}
?>
I want the variable $Code to be sent with the message.
Lets say the message is as follows:
<html>
<a href=" . $Code . '">Click Here</a>
</html>
The variable $Code is not subistuted with its value ABCD1234
Whats wrong?
I managed to make a page that I can fill some fields to send an HTML message and its working fantastic EXCEPT one thing
I can't include a variable inside the message, see my page's code:
<?
if ($HTTP_SERVER_VARS['REQUEST_METHOD'] != 'POST')
{
?>
<form method="post" action="<? echo $_SERVER[PHP_SELF] ?>">
Subject <input name="Subject"><br>
Message <textarea dir="ltr" name="Message" cols="60" rows="20"></textarea><br>
SendTo <input name="SendTo"><br>
<input type="submit">
</form>
<?
}
else
{
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859\r\n";
$headers .= "From: MyName <MyName@MyDomain.com>\r\n";
//Filter the message
$Message = str_replace(chr(34) , "", $HTTP_POST_VARS[Message]);
$Message = str_replace(chr(92) , "", $Message);
$Code = "ABCD1234";
//Send Emails
$MailValue = @mail($HTTP_POST_VARS[SendTo],$HTTP_POST_VARS[Subject],$Message,$headers);
echo "[$MailValue]";
}
?>
I want the variable $Code to be sent with the message.
Lets say the message is as follows:
<html>
<a href=" . $Code . '">Click Here</a>
</html>
The variable $Code is not subistuted with its value ABCD1234
Whats wrong?