Jump to content

Can't change color of a field


KenHorse

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.