aijosh
Member
Hello,
I'm editing a custom detail view and want to show a div only to logged in users.
I can see the values returned if I echo them
I'm editing a custom detail view and want to show a div only to logged in users.
I can see the values returned if I echo them
(0 when not logged in)
but The problem is that the value returned doesn't work in my if statement.
PHP:
<?php
$loggedin = '{$my->id}';
$loggedin = (string)$loggedin;
if ($loggedin == "0"){
echo '<div> You must be logged in to see this</div><a class="btn btn-mini btn-primary" href="/login">Login</a>';
}?>
I tried comparing logged in users id with itself and it still doesn't work.