cfgcjm Posted January 24, 2008 Share Posted January 24, 2008 I'm looking for some help on changing the class of a div tag based on a session variable. The variable is $_SESSION['username'] and i'd be looking to change the class name from hide to show Anyone know how to do this? Quote Link to comment https://forums.phpfreaks.com/topic/87470-changing-classes/ Share on other sites More sharing options...
predator Posted January 24, 2008 Share Posted January 24, 2008 well if the session is just checking a value in the div u would do this <div class="<? if($_SESSION['username'] ==1) { echo "class1"; } else { echo "class2"; } ?>"> Quote Link to comment https://forums.phpfreaks.com/topic/87470-changing-classes/#findComment-447382 Share on other sites More sharing options...
cfgcjm Posted January 24, 2008 Author Share Posted January 24, 2008 that worked...the only key is you cannot have the property you want to change as part of the standard properties of the div thanks Quote Link to comment https://forums.phpfreaks.com/topic/87470-changing-classes/#findComment-447404 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.