Php logon ideas-php Tutorial

Source: Internet
Author: User
The php login thought for a long time, but there was no result. The problem was as follows: to create a PHP + mysql chat room, you have to log in first to enter the chat room, one table records the user registration information one table records the user's speech information the question now is how to output a speech with the user name can only output the speech, because after the speech is recorded to the database and then output from the database, I don't know how to output a speech with a user name. I want to achieve this by using the user name + the speaker. I don't know how to contact the user name and the method used to speak in a php login.
I thought about it for half a day. I don't have any results. please try again.

The problem is as follows:
To create a PHP + mysql chat room, you must log on to the room first,
One table records user registration information
One table records the user's speech information


The question is how to output a speech with a user name

Currently, only speeches can be output, because the speeches are recorded in the database and then output from the database,
I don't know how to output a speech with a user name,
The method to achieve this is user name + speech
I don't know how the user name is associated with the speaker.

It is like a lot of websites that output comments with user names after login. I don't know how to implement it ..

------ Solution --------------------
... What is the idea? After logon, the user name is saved in session.
Add $ _ SESSION ['username'] to the output. isn't that enough?

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.