View Full Version : Create mailing list by selecting rows

03-06-2008, 02:53 PM

I currently have a table that shows the details of every member in the database.

What i am trying to achive is a way of providing the user with a method of selecting individual users ie.checkbox (and a select all function) to send a bulk email to.

I am familiar with the php mail fuinction but am not sure how to go about this so any ideas/examples would be great.

Here is the code for what i have got so far:

mysql_select_db($database_psc, $psc);
$query_rsAllMembers = "SELECT * FROM members ORDER BY surname ASC";
$rsAllMembers = mysql_query($query_rsAllMembers, $psc) or die(mysql_error());
$row_rsAllMembers = mysql_fetch_assoc($rsAllMembers);
$totalRows_rsAllMembers = mysql_num_rows($rsAllMembers);

form id="allmembers" name="allmembers" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="2">

<td class="tablecontent"><div align="center"><strong>Forename</strong></div></td>
<td class="tablecontent"><div align="center"><strong>Surname</strong></div></td>
<td class="tablecontent"><div align="center"><strong>Telephone</strong></div></td>
<td class="tablecontent"><div align="center"><strong>Email</strong></div></td>
<td class="tablecontent"><div align="center"><strong>Last Logged in</strong></div></td>
<td class="tablecontent"><div align="center"><strong>Mail</strong></div></td>
<?php do { ?>
<td height="44" class="tablecontent"><?php echo $row_rsAllMembers['fname']; ?></td>
<td class="tablecontent"><?php echo $row_rsAllMembers['surname']; ?></td>
<td class="tablecontent"><?php echo $row_rsAllMembers['telephone']; ?></td>
<td class="tablecontent"><?php echo $row_rsAllMembers['email']; ?></td>
<td class="tablecontent"><?php echo $row_rsAllMembers['login']; ?></td>
<td class="tablecontent">
<input name="CheckboxMail" type="checkbox" id="CheckboxMail" value="<?php echo $rsAllMembers['email'];?>" />
<?php } while ($row_rsAllMembers = mysql_fetch_assoc($rsAllMembers)); ?>


If you need more info please let me know


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum