at the moment I have this code:
if(isset($_POST[‘button_pressed’]))
{
$to = ‘[email protected]’;
$subject = ‘the subject’;
$message = ‘hello’;
$headers = ‘From: [email protected]’ . “\r\n” .
‘Reply-To: [email protected]’ . “\r\n” .
‘X-Mailer: PHP/’ . phpversion();
mail($to, $subject, $message, $headers);
echo ‘Email Sent.’;
}
the problem is that if the user bought 4 products, it sends me 4 emails. I want it to send 1 email.
Is there a function that has a if statement?
Thanks