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 = '';)

Then your PHP script can execute and see the value of $_GET['data']


* Cal Evans
* Journeyman Programmer
* Techno-Mage

-----Original Message-----
From: Steve Buehler [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 10:30 AM
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:

data = "hello world";
echo "$data<br>";

The above might at least give me a clue.  Just a note.  I really know
nothing to speak of about JavaScript.

Thanks in Advance

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to