Re: PHP-JavaScript
| From: | Richard Crawford | Date: | Mon, 21 Jan 2002 15:58:32 +0000 |
| Subject: | Re: PHP-JavaScript | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81378@lists.php.net to get a copy of this message | ||
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:rscrawford@mossroot.com] Sent: 20 January 2002 23:32 To: Mårten Andersson Cc: php-general@lists.php.net 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:rscrawford@mossroot.com http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: underpope@hotmail.com "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:rscrawford@mossroot.com http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: underpope@hotmail.com "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!"