Home  >  Article  >  Backend Development  >  php聊天室字体颜色有关问题

php聊天室字体颜色有关问题

WBOY
WBOYOriginal
2016-06-13 13:47:411048browse

php聊天室字体颜色问题
弄了个简单的PHP聊天室,在用户输入的时候可以选择字体颜色,
然后把颜色和输入内容都保存进了mysql,但是用户输入内容可以输出到网页,字体颜色不知道怎么输出,求解
list($chtime,$nick,$words,$usercolor)=mysql_fetch_row($result);

 echo $chtime; echo " "; echo $words;echo "
" ;

usercolor是字体颜色,用echo $usercolor,输出无效,
应该是我思路有问题,求解。

------解决方案--------------------
你得把字体颜色拼装成正确的html代码 或者css 

比如

选择了红色 $usercolor="red";

echo ''.$words.'
';

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]