Re: javascript and php
If you're wondering how to interchange the variables between JavaScript and
PHP, i.e.:
<Javascript section
... some code..
--> here you need to read a php variable (see php section below)
var x=document.getElementbyId("myElement").value
>
### <?php section
... some code.. ?>
<input type="hidden" name="myElement" value=" <?php echo "$myvar"; ?> ">
hidden type is used in order to make it unvisible on the screen.
I do not really know how to make it work the other way, i.e. PHP reading
vars from JScript, since PHP's processed first on the server and once it's
done there's only HTML code and JScript left.
Hope it was clear and close to your question.
"John Gelavis" <admin@tnet.com.au> wrote in message
news:3fde75ff$0$31746$c30e37c6@lon-reader.news.telstra.net...
> How do I integrate javascript within a php script? I am trying to
integrate
> a headline grabber (moreover) into a web page that is generated using php.
>
> I have searched the web but am having difficulty finding a definitive
> answer.
>
> --
> Regards,
>
> John
>
>
|