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? 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"; } ?>"> 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 Link to comment https://forums.phpfreaks.com/topic/87470-changing-classes/#findComment-447404 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.