Pls any time i view this page the email will be sending to the user that have birthday 4 the day. I want to send the email 0nce to the user even if the page is viewed many times. Pls help
<?php
$m=date("m");
$d=date("d");
?>
<?php
$chek=$db->select("SELECT * FROM b_users WHERE month='$m' AND day='$d' ORDER BY userid DESC LIMIT 0,10");
if($chek)
{
print "<div class='head'><font size='15'>Today is ";
foreach($chek as $postl)
{
if (($d==$postl->day) AND ($m==$postl->month)) echo "<b><a href=\"http://forum.gabbitto.com/profile.php?uid=".$postl->userid."\">".$postl->username."</a></b>, ";
}
print "birthday</font></div>";
$pmail = new PHPMailer();
$pmail->AddAddress($chek->$email);
$pmail->From = $config->adminemail;
$pmail->Subject = "Happy birthday ".$chek->username;
$pmail->Body = " Happy birthday $chek->username all the memberz of $config->title wishes you an Happy Birthday and a properous years ahead.
YOU ARE WELC0ME...<br>
".$config->title." Team<br><small>Note: Please Don't reply to this email. If you got this email by mistake then ignore this email.</small>";
$pmail->IsHTML(true);
$pmail->Send();
}
?>