Re: using php with java script
| From: | Markus | Date: | Mon, 03 Jul 2000 15:19:37 +0000 |
| Subject: | Re: using php with java script | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4588@lists.php.net to get a copy of this message | ||
>> i would like to know how to use php in javascript. is
>>there any way by which i can use variables of php in
>>javascript and vice versa.
> You can't access PHP variables from within javascript and vice versa.
As a matter of fact, you can. Because of the way php is placed inside your
html document, nothing prevents you from giving js variables values from
php, e.g. this way:
myvar=<?=$my_php_var?>;
On the other side, giving variables from js to php may be a little more
difficult. I assume using GET/POST would be the best, if not the only,
solution.
Note that I don't know much about js. This is just what I thought when
reading your posts.
Cheers,
markus