check out my code below. I'm displaying the variable BEFORE and AFTER the IF statements.
The value always changes to 1 after the IF statement. Any ideas why?
Thanks,
Noodles
(the variable $subscribe will be a 1 or a 0 depending on which checkbox was chosen)
print "<P>subscribe: $subscribe<P>";
$test = $subscribe;
print "<P>test: $test<P>";
Send Email Confirmations
if ($test = 0)
{
$greeting = "Please click on the link below to confirm you wish to be removed from our list.
\n [url]http://www._.com/emailadd.php?email=[/url]$email&subscribe=0
\n";
$msg .= "\n";
#mail("$email", "You have unsubscribed from the Mailing list", "$greeting $msg", "From: announce@__.com");
print "An email has been sent to $email. Please reply to it and you will be removed from our mailing list.";
}
if ($test = 1)
{
$greeting = "Thank you for signing up for the Mailing List.
\nPlease click on the link below to confirm you wish to be added.
\n [url]http://www.__.com/emailadd.php?email=[/url]$email&subscribe=1
\n";
$msg .= "\n";
#mail("$email", "You have signed up for the list", "$greeting $msg", "From: announce@__.com");
print "An email has been sent to $email for confirmation to be added.";
}
print "<P>subscribe: $subscribe<P>";
print "<P>test: $test<P>";
END OF MY CODE
now displaying $test ALWAYS shows as value of 1!!!
The IF statement, just by having the variable used in it, is changing the value of the variable.
Sounds like a bug to me. Any ideas?