> Is it possible to pass variables from a php page to a page using
> javascript, and vice versa,
> I've the variable - an array passed in the url of the page.

You can use PHP to write HTML or Javascript. You can submit data to PHP
through GET, POST, COOKIE, values. Those are your options.

So, if you have a PHP variable, that you want to pass to Javascript, then
you do this.

<? $my_php_var = "foo"; ?>
<script language='javascript'>
my_js_var = '<?=$my_php_var?>';
</script>

Now, to get your JS variable back to PHP, you have to include it in a form,
or tack it on to a URL. You can put it in a form as a hidden element.

Hope that helps,

---John Holmes...


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

Reply via email to