Solved

Accesing Windows Location from a browser

Posted on 2004-03-31
10
146 Views
Last Modified: 2010-04-06
I need to access Location (where you can set the country you're living) data from Regional and Language Option within Windows XP Control Panel from a browser.
Can this be done?
0
Comment
Question by:huevodelata
  • 2
  • 2
  • 2
  • +4
10 Comments
 

Expert Comment

by:ekriner
ID: 10727483
If the computer is running web enabled terminal services, I guess you could do it from a browser by terminal serving into your PC and accessing the CP from a browser window.
0
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10728398

I think it can also be done through the ipaddress...
0
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10728407

Sorry I misread your questions...

But I dont think this can be done...
0
 

Expert Comment

by:vicky_phadke
ID: 10730010
i have noticed this once. when i type google.com and try to view page. it automatically redirects me to google.co.in (since i m in india). i dont know how. but it does.
0
 
LVL 10

Expert Comment

by:frugle
ID: 10730048
The easy way (and most unreliable) is with JS and hope the user's browser userAgent stores the language, e.g. Mozilla/4.0 [en] (Win95; I)

You can find this with the following code:

<script language="JavaScript"><!--
var start = navigator.userAgent.indexOf('[');
if (start > -1) {
    var end = navigator.userAgent.indexOf(']');
    if (end > -1) {
        var language = navigator.userAgent.substring(start+1,end);
        document.write("<P>Language = " + language);
    }
}
//--></script>
 
To do it properly you need to read the Accept-Language header your browser sends e.g. en-gb

asp:
lang = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")

php:
$lang = $_SERVER["HTTP_ACCEPT_LANGUAGE"]

then redirect based on this.

Hope it helps,

Mike
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:huevodelata
ID: 10731870
I'm really thankful for your quick answers.
But i'll change the question a little bit.
Can i change the Language of a browser (not the Location of Windows XP) transparently to the client? This means without the Language Preference dialog box poping out.
The thing i need to do is: if a client choose a specified country in a pull-down combo, then change the Language of his browser properly, so the next time he enters the site he would be succefully redirected to the right site in the language of his country automatically, without asking him again. And i can't use cookies, sorry.
I thought a solution instatiating some Explorer object using the OBJECT tag in html in order to have more control of the browser, but that's too complicated i think.

Thanks again.
0
 
LVL 10

Expert Comment

by:frugle
ID: 10735677
You want to change the location of a users browser without asking them? I think that would cause more security issues than setting their homepage without their permission... how about I change your browser language to Korean without your permission? I'm not worried that you don't have the language pack, nor that you may not know how to change it back... a reinstall should sort you out :-)

Mike
0
 

Expert Comment

by:strolfey
ID: 10746753
I think it may be possible to do via apache configuration? Perhaps you might get some better luck there...
0
 
LVL 3

Accepted Solution

by:
Sleepyhead_NO earned 250 total points
ID: 10805678
"The thing i need to do is: if a client choose a specified country in a pull-down combo, then change the Language of his browser properly, so the next time he enters the site he would be succefully redirected to the right site in the language of his country automatically, without asking him again. And i can't use cookies, sorry."

Is this on your site (1)? Or is this on computers you are administrating (2)?

1: You have to use a cookie to save/change the setting. Alternatively automatically redirect based on IP or browser language as frugle explains in his comment.

2: Tools -> Internet Options -> Languages.

You cannot get the value from the reginonal settings in windows without a client side active-x script.
0
 

Author Comment

by:huevodelata
ID: 11398089
I realized it can't be done the way I want.

Thank all of you for your time.

G.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now