RE: [PHP] How can I use php codes in javascript?
| From: | Martin Towell | Date: | Thu, 20 Jun 2002 00:51:08 +0000 |
| Subject: | RE: [PHP] How can I use php codes in javascript? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-103051@lists.php.net to get a copy of this message | ||
PHP is server-side, JS is client-side
You can "use" variables from one in the other
eg: using PHP var in JS
<script>
myvar = <?= $myvar; ?>
</script>
eg: using JS var in PHP
<script>
window.location = "page.php?myvar="+myvar; // in php, this will appear
as $myvar
</script>
but you can't use code from one in the other
HTH
Martin
-----Original Message-----
From: Burak Delice [mailto:bdelice@abt.com.tr]
Sent: Thursday, June 20, 2002 10:50 AM
To: php-general@lists.php.net
Subject: [PHP] How can I use php codes in javascript?
hi,
I want to use php codes in a java function. Could you help me please. How
can I do this? is this possible? if it is, is there any example about this
on the Internet?
thank you very much.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php