Hi the below code is give me an error
Warning: Header may not contain more than a single header, new line detected. in /mnt/w0400/d11/s01/b02a5c57/www/etreasures.ca/Scripts/codeEmailMembers.php on line 29
I cannot figure out where the second header is being send from
any help is excellent
[code=php]
<?php
include (“../Connections/db.php”);
$subject = $_POST[‘subject’];
$message = $_POST[‘message’];
$x = 1;
$hold = 50; // quantity of emails sent before 3 sec delay
$emails = mysql_query(“SELECT email_address FROM members”);
$email_count=mysql_num_rows($emails);
while ($sendemail = mysql_fetch_array($emails)) {
$email = $sendemail[“email_address”];
mail($email, $subject,
$message, “From:eTreasures.ca <[email protected]>”);
$x++;
if($x == $hold) { // When $x is equal to $hold, a 3 sec delay will occur avoiding php to timeout
sleep(3);
$x = 0;
} // end of while loop
}
$msg .= “<script language=”JavaScript”>n”;
$msg .= “alert(‘$email_count email(s) have been sent’);n”;
$msg .= “</script>”;
header (“location: ../admin/emailMembers.php?msg=$msg”);
?>