Flash-PHP: how to get the server’s date and time

Today a fellow designer asked me how to retrieve the server’s date and time using Flash.
Since Flash is executed on the client, it reads the date and time of the client. The easiest way I could think of was using a bit of PHP.
We use PHP to get the server’s date and time, and then pass the value on to Flash using a flashvar.

Since I had to do this for a colleague, I’m sharing the final script here, in case someone else needs it.

See a working example or download the source files (24kb, ZIP, comments in italian only).


About this entry