so I have a form that people fill out to get their login details sent to them. No database or anything, just give me your username, account number, and email address and it's sent off to someone that sends them their login password. I want to have it so if the form is blank it can't be sent off, this is what I have but it sends the form regardless...
Code: Select all
$err = '0';
if($user === '' || $acct === '' || $email === '') {
$err = '1';
}
if($err !== 1) {
mail($to, $subject, $message, $headers);
}else{
echo "<p class='error'>There was an error processing your information. Please use your browser\'s back button and try again.</p>";
}
Like I said though, I tested the form and it sent off fine, so i tested again leaving the Account number field blank and it still sent off. I need some help on this one. Thank you.
Edit: Guess I should mention I already set everything with...
Code: Select all
$user = $_POST['user']; $acct = $_POST['account']; $email = $_POST['email'];
Is it just the syntax of my if statement?