One of the page from my presently under-contruction website can be seen on http://members.lycos.co.uk/darsh25/Personal%20Website/services.php

As it can be seen from the HEADER (right at the top) that I've the text-size selector (which isn't working, at the moment) along with the present date (as set in user's own computer).

Realising that such a "text-sizer" isn't quite a good idea since browser provides that facility anyway, I'm thinking to get rid-off this text-sizer and leave the "date" code as it is.

However, in the same HEADER area, I wonder if there's ANYTHING in PHP that allows to do the following:

>> Firstly, identify the "clock/time setting" in their computer and then display message saying "Good Morning/Afternoon/Evening".

>> Additionally, I would like this "Good Morning/Afternoon/Evening" appearing in viewers OWN language i.e. if he's from English speaking country then this message should appear in ENGLISH, if he's from French speaking country this message should appear in FRENCH, etc.

I've read a book few months back on PHP which said such a thing could be possible using a PHP script that identifies the "clock timing" along with the "language" set on viewers browser (or something like that).

I really DO NOT want to ask user about their language/country (and then display the message in THEIR language) since not all viewers would appreciate answering such question and beside the services of my website in itself isn't quite relevant to asking such question.

Hence, would there be anything within PHP script that identifies the relevant information (time & language/country) and then display the necessary "Welcome Message" such as:

> Good Morning, Hope you enjoy your stay (if user's location or brower setting is ENGLISH)
> Guten Morning, (same message in German) (if user's location or brower setting is GERMAN).
> Bonjour, (same message in French) (if user's location or brower setting is FRANCE/French speaking location).

Any idea, alternative thing to do instead, recommendation, help or guidance would be greatly appreciated.

12 Years
Discussion Span
Last Post by digital-ether

It would be better if you used JavaScript alone for this.

HTTP does allow sending of language headers, and I believe Timezone, but I dont think all browsers will send this to the server. So getting this out of PHP may not always be possible. (PHP gets the browser info from HTTP)

However, you can use javascript to send the timezone, computer clock time, and language (browser setting) to the server, or just write a javascript snippet that will do what you want with php but only on the browser.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.