I have a vote system that allows users to vote for items. Right now I am doing it by checking first if the user is logged in and then checking to see if they have already voted. I am wondering if there is a better way of doing this as I have been told that nested if statements are something to avoid.
My code:
if ($loggedIn) {
if($row['voted']){
You Already voted
}else{
<a href="#">Agree</a>
}
}else{
Please Register
}