Thanks for your help. I have the form & MySql up and working and from my initial tests it seems to be doing the job. I still have the echo command in and after submission it gives this:
where 1st one is $bycounty, 2nd is $countymail & 3rd is $county (the 3rd one is OK, not sure about the 2nd and the 1st appears to be an error)
Here's the part of the code:
Code:
//search database for relevant members
{
$x = 1;
$hold = 50;
$bycounty = mysql_query("SELECT `lookup`.`county_id`, `lookup`.`member_id`, `member`.`member_id`, `member`.`emaildj`FROM lookup, member WHERE (`county_id` = '$selection' AND `lookup`.`member_id` = `member`.`member_id`)")or die(mysql_error());
while ($countymail = mysql_fetch_array($bycounty)){ $emaildj = $countymail["emaildj"]or die(mysql_error());
//Sending Email to member
echo ("$bycounty, $countymail, $selection");
$header = "From: $email\n"
. "Reply-To: $email\n";
$subject = "Enquiry from Wedding DJ Association Site";
$email_to = "emaildj";
............... Message Content
$okemail = mail($emaildj, $subject, $message, "From:$email")or die(mysql_error());
$x++;
if($x == $hold) {
sleep(3);
$x = 0;
}
}
}
When I take out the echo command everything appears to work OK and the confirmation page comes up - but is there an obvious flaw in my coding?
Bookmarks