Re: PHP & JavaScript
| From: | Mike Migurski | Date: | Thu, 23 Oct 2003 01:11:10 +0000 |
| Subject: | Re: PHP & JavaScript | ||
| References: | 1 | Groups: | php.general php.windows |
| Request: | Send a blank email to php-general+get-167211@lists.php.net to get a copy of this message | ||
>Have somebody any idea how I could do something like that?
<snip javascript and PHP>
You're somewhat out of luck, as the chain of events in your typical HTTP
transaction looks something like this...
---->[time]--------------------------------->
client request received from browser
|
+-> PHP code executed on server
|
+-> text output to webserver (including javascript source)
|
+-> [drawing of cloud representing internet]
|
+-> text input to web browser on client side
|
+-> javascript executed by client
---->[time]--------------------------------->
...The only way to have the javascript affect the PHP, is to make a
subsequent request /back/ to the server after the javascript has started
executing. You can, for example, package the screen size into a GET
variable appended to an image request.
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html