Hello, Here is what im looking for, when a user opens my webpage, the script should detect the local time of a user's machine and save it to database or text file in my website. Some says that it is possible using javascript and php, but im weak in coding, could anyone pls help.... thanx in advance.
You get the time with Javascript first now = new Date(); Code (markup): Then send an Ajax post $.post('save.php',{time: now, ip : ip},function(){ } Code (markup): I dont really know how you are going to know which user is but, thats an example
hey robzdc, thanks.... i think cookies could be used to detect the user, wouldn't that work? it would be helpful if anyone could post here full source code.
Cookies are used by the server to save data on the user's computer. What you want is to save the user's time (or timezone?) on the server. That's done the way robzdc showed you. The complete code? That would depend on your current PHP code. What you're asking for is like a custom-fit shirt - we have to know your measurements first.
hello Rukbat, yes, you are right, but im not looking for a custom-fit-shirt as you mentioned, sorry i did not mention that in my previous post, i hope i can make it work in my websites doing some code modifications to detect the exact user. Examples of what im looking for can be found here - http://stackoverflow.com/questions/13/determining-a-web-users-time-zone , but they dont work. Hope you got my point. thanks
dollarearner - the stackoveflow link you posted explains how to do things perfectly. Show us what you tried and someone will be able to point out why it didn't work.