向同一页面的不同客户端显示不同的结果 [英] showing different result to different client of a same page

查看:103
本文介绍了向同一页面的不同客户端显示不同的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试第一手聊天室。我想向不同的客户端显示具有不同数据的相同



示例:

如果每条显示的消息都有用户的指示,那么当我看到它时,该值必须显示我但它必须显示你的朋友和我聊天的那个人。



我用PHP来聊聊MySQL并用AJAX来更新它。请帮帮我。任何建议都将受到高度赞赏。

谢谢,

Akky

解决方案

这是整个服务器端技术的基本点,包括PHP。您可以将任何自定义内容发送到HTTP响应;您可以动态生成内容,特别是使用条件运算符。您可以从MySQL数据库中获取当前经过身份验证的用户,查询用户的帐户记录以及与该用户关联的所有必需数据,并相应地生成内容。同样,您可以限制未经过身份验证的用户的页面内容,特别是将其发送到登录页面。



-SA

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

解决方案

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


这篇关于向同一页面的不同客户端显示不同的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆