如果... AND ... AND(...)或(...)[关闭]

I need to implement this in PHP:

if submit isset
 AND myname isset
 AND adress not empty 
 AND phonenumber not empty
 AND email not empty
 AND ( 
 institution OR g_year not empty (one should be 'full') 
   OR
 donation_p OR loan_p isset (should be set)
   OR
 donation_m OR loan_m isset (should be set)..
)

What i've wrote:

if ((isset($_POST['submit'])) 
     && ($_POST['myname'] != '') 
     && ($_POST['adress'] != '')   
     && ($_POST['phonenumber'] != '') 
     && ($_POST['email'] != '') 
     && (($_POST['institution'] != '') || ($_POST['g_year'] != ''))
         || ((isset($_POST['donation_p'])) && (isset($_POST['loan_p'])))
         || ((isset($_POST['donation_m'])) && (isset($_POST['loan_m']))))

What is wrong with my code?

I hope someone will give me answer.. i hope you understood what i want ;D

  1. You need "myname" set, but you are testing if myname != ''.
  2. You need "donation OR loan", but you are testing "donation AND loan".
  3. You should consider testing !empty($var) instead of $var != ''.

Try using if elseif else instead of what you are doing now, that should work!