用户是在办公室还是在家? [英] Is the user at office or home?

查看:75
本文介绍了用户是在办公室还是在家?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿!


我想知道是否可以知道用户是在家里(普通电脑),办公室/大学还是某个网络。 />

我的想法是禁用我的网站的一些功能,如果用户在他的工作中是不需要的。


也许这与共享IP或防火墙后面的用户有关......我真的不喜欢完全不知道。任何想法?


提前谢谢。

Hey!

I would like to know if it is possible to know if the user is at home (normal computer), or at office/university or some network.

My idea is to "disable" some features of my site that are not needed if the user is in his work.

Maybe this has something to do with shared IPs, or user behind firewall... I really don''t know exactly. Any ideas?

Thanks in advance.

推荐答案

您可以使用预定义的变量。

当然
You could probably make use of the Predefined variables.
Certainly


_SERVER,特别是

_SERVER, and in particular


PHP手册

''SERVER_ADDR''

执行当前脚本的服务器的IP地址。

''SERVER_NAME''

当前脚本执行所在的服务器主机的名称。

''REMOTE_ADDR''

用户查看当前页面的IP地址。

''REMOTE_HOST''

用户查看当前页面的主机名。
PHP Manual
''SERVER_ADDR''
The IP address of the server under which the current script is executing.
''SERVER_NAME''
The name of the server host under which the current script is executing.
''REMOTE_ADDR''
The IP address from which the user is viewing the current page.
''REMOTE_HOST''
The Host name from which the user is viewing the current page.


感谢您的回答,但是,我怎么知道IP是否共享,例如?
Thanks for your answer, but still, how do I know the IP is shared or not, for example?


这篇关于用户是在办公室还是在家?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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