This article has been dead for over three months
You
<!--~~~~~~ BUILD THE FORM FOR THE GENERAL MEMBERSHIP LIST ~~~~~~~~~~~~~~~~~~~~~~~~-->
<?php
// generate list of all names and email addresses for current members
$dataset_all = mysql_query("
SELECT id,firstname,lastname,email
FROM members
WHERE status = 'current'
ORDER BY lastname,firstname
");
// initialize this variable in which the list code will be built
$list = "";
// estimate # of rows needed for textearea
$addressrows = (mysql_num_rows($dataset_all) / 2)+1;
// now loop through the records, cleaning up the data and building the list
while ($thisrow = mysql_fetch_array($dataset_all)) {
// create a variable for each attribute
foreach($thisrow as $var => $value){
$$var = $value;
}
// capture and clean data from this record
$email = trim($email);
$name = "$firstname $lastname";
// append this name/address to the list
if ($thisrow["email"]) {
$list .= " $name <$email>; ";
}
}
// a last bit of clean up on the list
$list = trim($list); // trim whitespace
$list = rtrim($list,";"); // trim trailing semicolon
$list .= "\n"; // add a linefeed to facilitate cut and paste
// the list is now ready to be used in the form below.
?>
<form name="form_current">
<div style="border:1px solid tan;padding:10px;margin-bottom:15px;background-color:#fdf5e6;">
<span style="color:maroon;font-weight:bold;">General Membership</span> (Contains primary eMail addresses of all current members.)
<p><A href="mailto:<?php echo "$list"; ?>"><span style="font-weight:bold;border:1px solid tan;padding:0px 10px;margin-top:6px;background-color:#ffffff">Click here</span></a>
to open a message form with the addresses filled in. With some email programs, you will need to copy the address list from the box below.</p>
<textarea id="holdtext" name="select1" cols="100" rows="<?php echo "$addressrows"; ?>" class="textarea" style="font-size:80%;font-weight:normal;padding:10px;">
<?php echo "$list"; ?>