...

View Full Version : Javascript / PHP Date Function



danielwarner
10-13-2005, 09:09 PM
can anyone help with my problem. i need a script that can take the date and time from someones computer like javascript does but then implement it into a php shortcut e.g: $date_time;

thanks in advance :thumbsup:

felgall
10-13-2005, 11:19 PM
You will need to use Javascript on page 1 to retrieve the date/time and then pass it as a search string to page 2 where PHP can then retiieve it.

danielwarner
10-17-2005, 11:51 AM
could you please throw together a sample script for me then please?

Bill Posters
10-17-2005, 12:06 PM
You will need to use Javascript on page 1 to retrieve the date/time and then pass it as a search string to page 2 where PHP can then retiieve it.

Alternatively, you could 'bounce' it off of a cookie and bypass the need for a handler page.

i.e.
Use js to create the cookie with the user's local time as the value, then immediately follow that by using PHP to read the cookie value and commit it to a PHP variable.
All this can be done in the document head, so the PHP time variable is available anywhere in the construction of the page content.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum