Rectangle 27 0

javascript variable into php?


PHP code runs on the server (before your code is sent to the client browser), and JavaScript on the client (after the code is sent to the client browser). I'm not sure there is any other way to pass information to the server, other than sending a request to the server. so if you want to send something to your PHP application (server side) you'll have to send a request from your JavaScript code (client side). you may use AJAX techniques, but this causes another PHP process on the server to start. so you'll have to find a way to communication between the base PHP process (who created the JavaScript) and the new process (called by the JavaScript) to pass information. you may use server side data persistence like sessions or files or databases, or inter-process communication solutions like shared memory. but I guess this will get a little more complicated in implementation.

Note