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

WBOY
Release: 2016-06-13 13:47:41
Original
1160 people have browsed it

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.'
';

Related labels:
source:php.cn
Statement of this Website
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 admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template