Alternative Content By Access Level (2)
Below you can see the code used to generate and protect this page, so that registered users see the message "You have access" and all others will see "You DO NOT have access".
What the user sees
Message:
You DO NOT have access.
You DO NOT have access.
The code used
<?php if ($userSessionPro->hasAccessLevel(2)){ ?>
<div class="demoMessage">Message:<br />You have access.</div>
<?php }else{ ?>
<div class="demoMessage">Message:<br />You DO NOT have access.</div>
<?php } ?>