Is the following php code correct? It’s in the context of a component that I’m modifying for Joomla. I want to create conditional if statements for a refer-a-friend program. For each person that’s referred, the referrer get’s one dollar of their purchase for up to $5. Please help…
[php]if ($recommend_to_email0 !== “” && $recommend_to_email1 == “” && $recommend_to_email2 == “” && $recommend_to_email3 == “” && $recommend_to_email4 == “”) {
echo ‘[ Download ]’;
} elseif ($recommend_to_email0 !== “” && $recommend_to_email1 !== “” && $recommend_to_email2 == “” && $recommend_to_email3 == “” && $recommend_to_email4 == “”) {
echo ‘[ Download ]’;
} elseif ($recommend_to_email2 == “” && $recommend_to_email1 == “” && $recommend_to_email0 == “” && $recommend_to_email3 !== “” && $recommend_to_email4 !== “”) {
echo ‘[ Download ]’;
} elseif ($recommend_to_email3 == “” && $recommend_to_email1 == “” && $recommend_to_email2 == “” && $recommend_to_email0 == “” && $recommend_to_email4 !== “”) {
echo ‘[ Download ]’;
} elseif ($recommend_to_email4 == “” && $recommend_to_email3 == “” && $recommend_to_email2 == “” && $recommend_to_email1 == “” && $recommend_to_email0 == “”) {
echo ‘[ Download ]’;
}[/php]