Hi,
Can anyone tell me what is wrong with my code? I am trying to have an email sent to the email addy hardcoded informing the the email receiver that the info was sent into the DB...and when I do add a user, no email was sent...only the registration data was added to the DB...
function addNewOperator($Badge, $fn, $ln, $username, $password)
{
global $conn;
$f=strtoupper(substr ( $fn, 0 , 1 ));
$l=strtoupper(substr ( $ln, 0 , 1 ));
$initials=$f."".$l;
$al="NULL";
$q = "INSERT INTO Operators (EmployeeID,LastName,FirstName,Initials,username,password,accessLevel) VALUES ('$Badge','$ln','$fn','$initials','$username', '$password','$al')";
return mysql_query($q,$conn);
//sends an email notification to administrator about new account registered.
if($al=="NULL")
{
$mailheaders = "From : ".'$username'."\n";
$mailheaders = "Goodday, \n I just registered in the your Website.\n Awaiting your finalization.";
$to = "someone@somewhere.com";
$subject = "New Account";
mail($to,$subject,$mailheaders);
}
}