Re: Java variables - PHP varialbles

From: Date: Sun, 04 Feb 2001 03:00:47 +0000
Subject: Re: Java variables - PHP varialbles
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38054@lists.php.net to get a copy of this message
> Can someone tell me how we can assign the content of a PHP > variable to a Java variables in a script (and vice versa). PHP -> JavaScript is easy: <?php echo "\n<SCRIPT LANGUAGE=JavaScript>\n"; echo " document.foo = $foo;\n"; echo "\n</SCRIPT>\n"; ?> The other way around is a bit tougher... You see, PHP runs on the server and spits out your web-page to your browser. Then, the page is done, so the server/browser close the connection and aren't really talking to each other. Then, your JavaScript starts executing. Now, if you want your JavaScript to interact with PHP, your JavaScript has to open up a whole new connection to some other page, or the same page, but it has to pass in any values and start over. It's a whole new run of a PHP script either way, and makes for a rather slow web-site except in certain specialized cases.

« previous php.general (#38054) next »