php - User login show element -
this question has answer here:
- php parse/syntax errors; , how solve them? 12 answers
i'm wanting show element when logged in user. , when not logged in hidden. php parse error: syntax error, unexpected '<'. please on , upfront
<?php if ($_session['usrname']) { <style type="text/css">#lah{ display:visible;} </style> } else { <style type="text/css">#lah{ display:none; }</style> } ?>
you blending php html. need either echo html or drop out of php while entering html.
try this:
<?php if ($_session['usrname']) { ?> <style type="text/css">#lah <?php { ?> display:visible; </style> <?php } } else { ?> <style type="text/css">#lah <?php { ?> display:none; </style> <?php } } ?>
Comments
Post a Comment