Php chat room font color problems

Source: Internet
Author: User
The font color of the php chat room makes a simple PHP chat room. you can select the font color when entering the text, and then save the color and input content to mysql, however, the user input content can be output to the webpage, and the font color does not know how to output the content, solving the list ($ chtime, $ nick, $ words, $ usercolor) mysql_fetch_row ($ result); & nbsp; echo $ chtime; e php chat room font color problem
After a simple PHP chat room, you can select the font color when entering the text,
The color and input content are saved in mysql, but the user input content can be output to the webpage. the font color does not know how to output it.
List ($ chtime, $ nick, $ words, $ usercolor) = mysql_fetch_row ($ result );

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

Usercolor is the font color. echo $ usercolor is used. the output is invalid,
It should be because I have a problem with my thinking.

------ Solution --------------------
You have to assemble the font color into the correct html code or css.

For example

Red $ usercolor = "red ";

Echo ''. $ words .'
';

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.