RE: [PHP] javascript and PHP

From: Date: Mon, 29 Apr 2002 15:34:13 +0000
Subject: RE: [PHP] javascript and PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-95176@lists.php.net to get a copy of this message
since php runs on the server, not on the client, you have to pass the value of data back to the server. Normally, this is done via a GET or a POST from a form or by building a URL and using javascript to load it. (i.e. document.location = 'http://myserver.com/mypage.php?data=Hello%20World';) Then your PHP script can execute and see the value of $_GET['data'] HTH, Cal * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -----Original Message----- From: Steve Buehler [mailto:steve@vespro.com] Sent: Monday, April 29, 2002 10:30 AM To: php-general@lists.php.net Subject: [PHP] javascript and PHP Does anybody know of a good/short tutorial about passing variables from JavaScript to/from PHP? For example, how to do the following: <html> <head> <SCRIPT LANGUAGE="JavaScript"> data = "hello world"; </script> </head> <body> <? echo "$data<br>"; ?> </body> </html> The above might at least give me a clue. Just a note. I really know nothing to speak of about JavaScript. Thanks in Advance Steve

« previous php.general (#95176) next »