RE: [PHP-WIN] Passing Javascript Variables to PHP

From: Date: Tue, 02 Apr 2002 21:37:31 +0000
Subject: RE: [PHP-WIN] Passing Javascript Variables to PHP
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-12908@lists.php.net to get a copy of this message
Another way to pass data from JavaScript <-> PHP is with cookies. Use JavaScript to set the cookie and once you reload the script, PHP will have access to the variables stored in the cookie. I implemented this in a real-time trivia game (using PHP for the backend logic, and JavaScript for the client-side logic), and it worked quite well. -----Original Message----- From: Mike Flynn [mailto:mike@mikeflynn.net] Sent: April 2, 2002 13:34 To: hinchy2000@lineone.net; php-windows@lists.php.net Subject: Re: [PHP-WIN] Passing Javascript Variables to PHP I have answered variations on this question at least 3 times. Please check the archives. JavaScript is client-side, PHP is server-side. The only way to go from JavaScript to PHP (in that direction) is by going to a new page -- 1. Reloading the current page, with the relevant data in the query string; 2. Loading a new page, with the relevant data in the query string; 3. Submitting a form, with the relevant data in hidden or other kinds of fields. -Mike At 07:09 PM 4/2/02 +0100, Wayne Hinch wrote: >Hi all, > >Does anyone know if it is possible to pass variables from JavaScript to >PHP? > >Any help will be much appreciated > >Many Thanks -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.windows (#12908) next »