Posted by AndreHebben on 11/19/07 08:19
On Nov 19, 8:40 am, pradnya <pdu...@gmail.com> wrote:
> How to share/use a variable between PHP and HTML on the same page ?
> ( i.e. without using GET/ POST etc.... )
>
> Is it possible ?
>
> And what about same with PHP and JavaScript ?
You can share through from PHP to HTML just one way (server->client)
through a hidden input field
Example:
<INPUT TYPE="hidden" NAME="htmlvar" value=<?php echo $phpvar ?> />
For Javascript it is then possible to access it.
For two way communication you should really look into AJAX/ JSON
principles
Navigation:
[Reply to this message]
|