php - User login show element -


this question has answer here:

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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -