can php do this?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

can php do this?

Post by m3mn0n »

Since Microsoft does publish ASP/ASP.NET i know they have exclusive access to programming features that involve Windows, and they can even develop Windows to work with thoses features. If you don't know what i'm talking about yet, here is an example; I went to a shopping cart built in ASP, this cart already knew where i lived (not exactally just my country), i presume it did some sort of OS reference check in ASP, which is i'm sure the case.

Now my query is, can php do this? Not just that particular thing, but tell what OS a person uses or other OS related variables.

Thanks for your time. :)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

did it know more than it should have been able to from content-negotation and the user agent string?
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Not that is displayed, no. All i know it knew about me was my location.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

when I use http://php.net/fopen I end up at http://www.php.net/manual/de/function.fopen.php because de is configured as the prefered language. Maybe it's that simple.
e.g.

Code: Select all

<?php echo $_SERVER['HTTP_ACCEPT_LANGUAGE']; ?>
gives me
de, en;q=0.66, en-us;q=0.33
if requested with mozilla

http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html
http://httpd.apache.org/docs-2.0/conten ... ation.html
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

I bet it's due to this....
php.net wrote: Set your own language preference
[01-Mar-2003] Starting from today, your browser's "Accept Language" setting is also honored on language sensitive pages on the php.net site. If you would like to get to the documentation page of echo for example, you can use the /echo shortcut on all mirror sites, if your browser is set to provide your language preference information to the server. This also makes the PHP error message links point to the documentation in your preferred language.

You can set your preferences under Edit/Preferences/Navigator/Languages in Mozilla, and under Tools/Internet Options/Languages in Internet Explorer. This will probably also enhance your web experience on sites providing translated content.
...:wink:

Thanks for the links volka. =)
Post Reply