Unfortunately, that won't work if the value of the JS variable needs to 
change dynamically based on user interaction; document.write() only 
works as the page is loaded (well... MSIE might be different, but 
writing MSIE-only code is a bad practice).

The best bet is to use an input field; input fields can change 
dynamically, and the value can be captured using JS's DOM.

But there is absolutely no way around the fact that to send a JS 
variable to a PHP script, you must send that variable back to the server 
via POST or GET.



Tim Ward wrote:

> Or get the JS to rewrite a query string in a link, but personally I wouldn't
> rely on JS that far.
> 
> Tim
> www.chessish.com <http://www.chessish.com> 
> 
>       ----------
>       From:  Richard Crawford [SMTP:[EMAIL PROTECTED]]
>       Sent:  20 January 2002 23:32
>       To:  Mårten Andersson
>       Cc:  [EMAIL PROTECTED]
>       Subject:  Re: [PHP] PHP-JavaScript
> 
>       In a word... No.
> 
>       Well...
> 
>       No.
> 
> 
>       Mårten Andersson wrote:
> 
>       > Is it posible to get values from javascript to PHP? Without having
> to 
>       > post the variables..
>       > 
>       > Thanks //Mårten
>       > 
>       > _________________________________________________________________
>       > Chatta med vänner online, prova MSN Messenger:
> http://messenger.msn.se
>       > 
>       > 
> 
> 
> 
>       -- 
>       Sliante,
>       Richard S. Crawford
> 
>       mailto:[EMAIL PROTECTED] 
>               http://www.mossroot.com
>       AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
>       MSN:  [EMAIL PROTECTED]
> 
>       "It is only with the heart that we see rightly; what is essential is
> 
>       invisible to the eye."  --Antoine de Saint Exupery
> 
>       "Push the button, Max!"
> 
>       
> 
> 
> 



-- 
Sliante,
Richard S. Crawford

mailto:[EMAIL PROTECTED] 
        http://www.mossroot.com
AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
MSN:  [EMAIL PROTECTED]

"It is only with the heart that we see rightly; what is essential is 
invisible to the eye."  --Antoine de Saint Exupery

"Push the button, Max!"



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to