KenHorse Posted September 27, 2018 Share Posted September 27, 2018 Consider the following snippet: print " <td align=\"center\">"; if($row[changed]){print "<B><RED>";} print "<a href=\"editmacrorc.php?id=$row[id]&port=$port&tab=$tab\">"; The tag <RED> is a CSS entry that works fine in other code I use: RED {color:red} As you may see, we read in data from a MySQL database and if the 'changed' field contains a '1', we want to make the displayed character bolded and also RED. And if that character is clicked, take us to the new php file (that all works fine). But only the BOLD is displayed but it is not in RED. Not really sure if this an HTML or PHP issue but help! :D Quote Link to comment https://forums.phpfreaks.com/topic/307733-cant-change-color-of-a-field/ Share on other sites More sharing options...
Barand Posted September 27, 2018 Share Posted September 27, 2018 CSS <style type='text/css'> .redlink {color: red; font-weight: 600} </style> HTML <a class="redlink" href="whatever">Hello World</a> Quote Link to comment https://forums.phpfreaks.com/topic/307733-cant-change-color-of-a-field/#findComment-1561175 Share on other sites More sharing options...
benanamen Posted September 27, 2018 Share Posted September 27, 2018 (edited) You have numerous basic errors. You are missing a period before the RED css. You are also missing quotes on your row variables. If you had error reporting turned on you would have known about that. If you used single quotes in your html strings you wouldnt have to do all that escaping. The center tag is obsolete. You will also get an error with your row[id]. It will need to be {row['id']}. If this is not for tabular data, then don't use tables Edited September 27, 2018 by benanamen Quote Link to comment https://forums.phpfreaks.com/topic/307733-cant-change-color-of-a-field/#findComment-1561176 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.