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:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 10:30 AM
To: [EMAIL PROTECTED]
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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to