Re: passing PHP variables to Javascript ...
| From: | CPT John W. Holmes | Date: | Mon, 17 Nov 2003 19:47:23 +0000 |
| Subject: | Re: passing PHP variables to Javascript ... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-169997@lists.php.net to get a copy of this message | ||
From: "Kenn Murrah" <kenn@thebytebusiness.com>
> I need to be able to pass a PHP variable to a Javascript and can't
> figure out how to do it. In short, the Javascript win() statement is
> used open a page as defined in PHP -- i.e., $php_name =
> "http://www.somewhere.com/something/3.jpg" , a
> filename that was
> generated dynamically in PHP ... how do I pass that variable to my
> Javascript routine?
<script language = "JavaScript">
var mywin = '<?=$php_name?>';
win(mywin);
</script>
or something like that.
---John Holmes...