Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys,
I am trying my first hand on chat room. I want to show same
having different data to different client.
Example :
If every shown message has the indication of the user by which it is done, that value must show "Me" when I see it but it must show "Your friend" to the one with whom I am chatting with.

I am using PHP to get chat from MySQL and using AJAX to update it. Please help me out. Any suggestion would be highly appreciated.
Thanks,
Akky
Posted

1 solution

This is the whole very basic point of all server-side technologies, including PHP. You can send any custom content to your HTTP response; you can generate content on the fly and, in particular, use conditional operators. You can get the current authenticated user, query the user's account record and all required data associated with the user from your MySQL database and generate content accordingly. Likewise, you can limit the page content for a non-authenticated user, in particular, send one to the log in page.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900