473,404 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Is the user at office or home?

nunoperalta
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.
Jun 23 '09 #1
12 1461
code green
1,726 Expert 1GB
You could probably make use of the Predefined variables.
Certainly $_SERVER, and in particular

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.
Jun 23 '09 #2
Thanks for your answer, but still, how do I know the IP is shared or not, for example?
Jun 23 '09 #3
code green
1,726 Expert 1GB
Well you can't directly.
There are online tools that can help but they are not guaranteed to be right.
If you know the user is using a specific ISP you could get all their IP addresses
into a lookup table and run a search on this
Jun 23 '09 #4
Ok cool, thanks a lot :) I will research about this, more!
Jun 23 '09 #5
dlite922
1,584 Expert 1GB
@nunoperalta
I'm curious, what would be an example of a feature you would disable if user is at work vs home?

Why does the physical location matter?



Dan ::devil's adv::
Jun 23 '09 #6
Like... the automatic chat with friends?
Like... the automatic selected "Remember Me" option in login?
Too many stuff can be an issue...
Jun 23 '09 #7
dlite922
1,584 Expert 1GB
@nunoperalta
Again,

why can't they chat with friends automatically at the home or automatically have the Remember Me option from home or anywhere else?

Excuse me, but I fail to see your point and reason to do this.



Dan
Jun 23 '09 #8
No.. it's the opposite. At work/public place, "Remember Me" should not be selected by default, right? If the user forgets to logout.....
Jun 23 '09 #9
dlite922
1,584 Expert 1GB
@nunoperalta
Wouldn't be good for the user to choose where and when they want to store their login and session since most modern browsers have the capability of storing login information?

What if I'm at my uncle's house and I'm using his computer. Would you store my session because I'm in a home? What if I'm at work and I'm the only person who ever has access to this computer?

It's best to leave that alone or treat all user's indiscriminately of location.

The more you control -> the more you'll restrict -> the less user friendly your app will be.


Dan
Jun 23 '09 #10
But, I am not forbidding anyone! I am just trying to avoid some problems... I didn't say "remove features", i said "disable by default", but you can enable again if you want...
Jun 23 '09 #11
dlite922
1,584 Expert 1GB
Automatically selecting a default option is a feature, no? :)

I guess now we've come down to terminology. My point wasn't specific to this exact use of your "Remember Me" feature, but to the underlying concept.

I'll end with the argument that trying to locate where the user is based on network and IP is like guessing they're ethnicity based on location. It's not something that is possible to do accurately, or even significantly reliable, so no one ever does it. It's just not worth the coding time.

more importantly, Have fun!




Dan
Jun 23 '09 #12
It's ok, no problem! I appreciate your opinion :)

Thanks for your time. I will think about this to get the best way to do the things.
Jun 23 '09 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Fred | last post by:
Hi. Is it safe to instll Access 2000 on a system that already has Windows XP and Office 2002 (Word, Excel Access, Powerpoint). Anyone done this? I would install it in a searate directory but...
1
by: chuliu | last post by:
I want to develop the project from my home pc and the project is originally in my office developing by a group of developers, myself included. VSS is implemented. I am running win2k pro in my...
1
by: kang jia | last post by:
hi when user entered particulars in signuppage and click" signup" button, i will direct them to do_signup.php. if say the NRIC is dupicate in datebase, i will redirect them back to signup page...
2
by: =?Utf-8?B?Sk1D?= | last post by:
Will any of the programs in 2007 Office Home & Student work with Office Outlook 2003? Will any of the programs in 2007 Office Home & Student do the same things as in Works 8 Word Processor, like...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.