What I have: <?if($pmp['status'] == admin || $pmp['status'] == moderator){?> *message*?> <?}?> Code (markup): What I want: <?if($pmp['status'] == admin || $pmp['status'] == moderator AND $pimp['status'] == normal){?> *message*?> <?}?> Code (markup): (this is wrong, because it didn't work as I wanted) This didn't worked but what I tried to make was that *message* shows in 2 cases: case 1, when $pmp['status'] == admin case 2, when $pmp['status'] == moderator and $pimp['status'] == normal
if ($pmp['status'] == 'admin' OR ($pmp['status'] == 'moderator' AND $pimp['status'] == 'normal')) PHP: ... use quotes around the strings (admin, moderator, normal), unless they're defined constants. And I added parenthesis, to group it. Give it a try.
I couldn't get it to work. Could you add the full code with the openings and closings? I don't know much about php... Here is what i tried: <?if ($pmp['status'] == 'admin' OR ($pmp['status'] == 'moderator' AND $pimp['status'] == 'normal'))?> *message* <?}?> </p> Code (markup): The ending is wrong i think. I tried many and got errors like: Parse error: syntax error, unexpected '}' Parse error: syntax error, unexpected ')'' etc...
Try this : <?php if (($pmp['status'] == 'admin') || (($pmp['status'] == 'moderator') && ($pmp['status'] == 'normal'))) { ?> <p>your html message here</p> <?php } ?> PHP: