Steph wrote:
Does someone know how can we bring variables from a PHP script to a
Javascript one ?
I have to build a Javascript function that needs variables generated by a
PHP script but i do not know the way to retrieve them into Javascript.
All the PHP runs on the server, then all the JavaScript runs on the client.
For PHP to send information to JavaScript it has to output JavaScript code.
<script type="text/javascript">
var foo = "<?php echo $foo; ?>";
</script>
For JavaScript to send information to PHP, it has to get the browser to make
a new HTTP request.
document.location = "http://www.example.com/myScript.php?foo=" + foo;
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is