Solved

Accesing Windows Location from a browser

Posted on 2004-03-31
10
147 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

930 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

6 Experts available now in Live!

Get 1:1 Help Now