NYCPHP Meetup

NYPHP.org

[nycphp-talk] Passing JAVASCRIPT variables to PHP

Donald J Organ IV dorgan at donaldorgan.com
Tue Apr 1 15:54:09 EDT 2008


Why not just store the client time zone and store server data/time??


PaulCheung wrote:
> Hi
>
> All I am trying to do is transfer the data and time from the client 
> machine upto the server. The goal is to create a MySQL record by 
> customer number and store both the client time/date and server 
> time/date for each new record created .
>
> Paul
>
> ----- Original Message ----- From: "Brian D." <brian at realm3.com>
> To: "NYPHP Talk" <talk at lists.nyphp.org>
> Sent: Tuesday, April 01, 2008 12:25 AM
> Subject: Re: [nycphp-talk] Passing JAVASCRIPT variables to PHP
>
>
>> Susan hit the nail on the head. She's pointing out why I said it was a
>> "hack" - if you're not understanding the problem correctly (the
>> difference between client-side and server-side) then the proposed
>> solution might be "simple and workable" but it's still wrong.
>>
>> More to the point, what exactly are your goals with this code, Paul?
>> Are you just trying to get the exact time on the client's computer?
>> Are you just trying to create a timestamp in their timezone?
>>
>> On Mon, Mar 31, 2008 at 6:51 PM, Susan Shemin 
>> <susan_shemin at yahoo.com> wrote:
>>>
>>>
>>>
>>> I'm watching this discussion with interest since I asked a similar 
>>> question
>>> last month (about sending PHP stats from a JS onclick event).  The 
>>> answer
>>> that came up was to put a redirect to the link page, run the PHP 
>>> script on a
>>> redirect.php page and then send it on to the destination.
>>>
>>>
>>>
>>> I've set it up this way and it's working fantastically, but I have 
>>> tons of
>>> links and I'm beginning to feel hesitant about sending users to a 
>>> redirect
>>> when there's so many harmful redirects out there.  (Of course, not 
>>> mine...)
>>>
>>>
>>>
>>> Just as this question came up here, I was again researching it on the
>>> internet, and very clearly saw that the crux of the problem is that
>>> Javascript is client side and PHP server side, meaning the 2 don't mix
>>> unless in Ajax.
>>>
>>>
>>>
>>> So I'm off to brush up on my Ajax and get it working, because except 
>>> for the
>>> redirect, I can only see that Ajax will work.
>>>
>>>
>>>
>>> Susan
>>>
>>>
>>> _______________________________________________
>>>  New York PHP Community Talk Mailing List
>>>  http://lists.nyphp.org/mailman/listinfo/talk
>>>
>>>  NYPHPCon 2006 Presentations Online
>>>  http://www.nyphpcon.com
>>>
>>>  Show Your Participation in New York PHP
>>>  http://www.nyphp.org/show_participation.php
>>>
>>
>>
>>
>> -- 
>> realm3 web applications [realm3.com]
>> freelance consulting, application development
>> (917) 512-3594
>> _______________________________________________
>> New York PHP Community Talk Mailing List
>> http://lists.nyphp.org/mailman/listinfo/talk
>>
>> NYPHPCon 2006 Presentations Online
>> http://www.nyphpcon.com
>>
>> Show Your Participation in New York PHP
>> http://www.nyphp.org/show_participation.php 
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php




More information about the talk mailing list