I'm trying to develop a system to send mass emails to a group of people. The system involves a mySQL database and phpmailer, plus php and an html form.
I'm curious of a good way to get the addresses that are selected in from the form into an array or something that i can send emails through.
for starters i get the emails out of the database.
<?
$sql = "SELECT exec.position, exec.office_id, brothers.fname, brothers.lname, brothers.brother_id, brothers.email
FROM exec
LEFT JOIN brothers
ON exec.brother_id = brothers.brother_id ORDER BY office_id ASC";
?>
then I create the form that displays the names of the people corresponding to the address.
$result = mysql_query($sql);
if ($result > 0 ){
//$i=0;
while ($row = mysql_fetch_array($result)){
//if (!($i%2)) {
//echo "<tr>";
//}
//$i++;
//}
echo "<td><input type=\"checkbox\" name=\"email\" value=".$row['email']." />";
echo "</td>";
echo "<td>".$row['fname']." ".$row['lname'];
echo " - ".$row['position'];
echo "</td></tr>";
}
}
else {
echo "No Rows Returned";
}
?>
</table>
<br />
<br />
<table class="news_table">
<tr><td class="newstitle" colspan="4">All Other Active Brothers</td></tr>
From this form...(there is a submit button and all of that plus more address getting functions.)
I don't know a good way to get or maybe a better way to name each field so that the parameters are easier to get to in php. Currently i try to read the addresses selected into an array called $email but it just gives me the last address selected. Does anyone know of a better way? Please help me with this. Thank you in advance