Hi
Im having problems adding info from a database into a personalised email.
At present I can email x amount of friends, but I would like to personalise it, like
dear ......
your password is......
these 2 .... are already in the mysql database, I just need to allow a variable for it to be added
eg
dear %name%
your password is %password%
this is the script as it stands
<form name="form1" method="post" action="*****">
<table width="100%" border="0" cellspacing="5" cellpadding="0" height="8">
<tr>
<td height="2" class="btext" colspan="7"> </td>
</tr>
<tr>
<td height="2" class="btext" colspan="7">
<div align="center">
<?php
$str_q = "select from $member_info order by mem_id desc";
$res_q = mysql_query($str_q) or die(mysql_error());
for($i = mysql_num_rows($res_q)-1;$i>=0;$i--)
{
if ( mysql_result($res_q,$i,"mem_id" ) >= $from_id and mysql_result($res_q,$i,"mem_id" ) <= $to_id)
{
$email = mysql_result($res_q,$i,"mem_email" );
$fr = "From: <>".$from;
mail($email,$subject,$mesg,$fr);
}//if
}//for
Is there any one who can help,
I would be very much obliged, Im totally beaten !!!
Thanks