lingo5 Posted November 26, 2011 Share Posted November 26, 2011 Hi, I have this code to assign a CSS style to a button dependingon which page we are: <td width="13%" valign="middle"><?php echo '<a href="PC_clientes_display.php"'; if(strstr($checkit,"PC_clientes_display.php")) echo ' class="clicked"'; else echo ' class="menulinks"'; echo '>CNT_TXT_ADMIN_CLIENTES</a>'; ?></td> Mi problem is that the constant CNT_TXT_ADMIN_CLIENTES is not displaying. I know it must be a syntax error but I can' seem to figure it out. Thanks!! Quote Link to comment https://forums.phpfreaks.com/topic/251837-please-help-with-constant-syntax/ Share on other sites More sharing options...
kicken Posted November 26, 2011 Share Posted November 26, 2011 If you want the constant replaced with it's value, you have to concatenate it with the string, not just embed it. echo '>'.CNT_TXT_ADMIN_CLIENTES.'</a>'; Quote Link to comment https://forums.phpfreaks.com/topic/251837-please-help-with-constant-syntax/#findComment-1291331 Share on other sites More sharing options...
lingo5 Posted November 26, 2011 Author Share Posted November 26, 2011 Thanks Kicken...and sorry about asking such simple questions..I'm still learning. Quote Link to comment https://forums.phpfreaks.com/topic/251837-please-help-with-constant-syntax/#findComment-1291333 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.