NYCPHP Meetup

[nycphp-talk] Passing JAVASCRIPT variables to PHP

tedd tedd at sperling.com
Mon Mar 31 09:27:31 EDT 2008


At 6:07 PM -0400 3/30/08, Daniel Convissor wrote:
>Hi Paul:
>
>On Sun, Mar 30, 2008 at 09:18:10PM +0100, PaulCheung wrote:
>
>>  The problem is I cannot transfer the Javascript variable needed in to PHP.
>
>JavaScript is client side.  PHP is server side.  This has been discussed
>on this list a couple times, and on the web too many times to count.
>
>You either need to submit the JS data to the server as part of a form or
>via an AJAX request.
>
>--Dan


--Dan:

And don't forget this way:  :-)

var a = 1;
(new Image()).src = '/myscript.php?a='+ a;

Cheers,

tedd

-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the talk mailing list