dasein Posted May 10, 2011 Share Posted May 10, 2011 I'm writing a <font color> to mysql for later retrieval but the colors don't make sense. It's posted and retrieved in PHP. If I put in <font color=\"#ff0000\">RED</font> it gets properly stored in the db (I can see it) but it gets retrieved and shows up green instead. I've tried doing the stripslashes() with addslashes(), tried <font color=\"#red\">RED</font> and <font color=\"red\">RED</font>.. no matter what config I try, I always get the word RED showing up green as if I had used <font color=\"#00ff00\">RED</font> instead (when I tried <font color=\"#00ff00\">RED</font> it shows up black. I give. What am I doing wrong? I know it's something dumb, but I can't find a similar issue with any searches. BTW, viewing the Source Code from the rendered page when it's posted shows it's properly tagged as red: color=\"#ff0000\" .Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/236013-storing-colors-in-db/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 10, 2011 Share Posted May 10, 2011 No one can possibly help you with what your code is doing without seeing your code. I'll guess you have an error in your logic that is replacing the value rather than testing the value. Quote Link to comment https://forums.phpfreaks.com/topic/236013-storing-colors-in-db/#findComment-1213347 Share on other sites More sharing options...
HDFilmMaker2112 Posted May 10, 2011 Share Posted May 10, 2011 You realize the <font> tag is deprecated in HTML right? You should be using CSS, with either a separate style sheet or "style="color: #ff0000;" in the corresponding div, span, or p tag. Quote Link to comment https://forums.phpfreaks.com/topic/236013-storing-colors-in-db/#findComment-1213348 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.