Re: PHP & Javascript

From: Date: Wed, 18 Apr 2007 15:17:19 +0000
Subject: Re: PHP & Javascript
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-27720@lists.php.net to get a copy of this message
Mikael Grön wrote:
Google! is your friend, but I acutally enjoy typing. :) Do something like this: <script type="text/javascript"> window.location="another.php?UID=<?php echo $thevariablecontainingthenumbertwo; ?>"; </script> or something like that. :) You know, PHP parses before the browser gets to do JavaScript stuff, so when the browser gets the code, it'll say UID=2 ... or what ever variable you've got stored in $thevariablecontainingthenumbertwo. Thank you Mikael.
One of my problems is getting my mind around what happens on the client and what happens on the server. Even though I knew that PHP parses on the server and the result of that is sent to the client where javascript operates the solution you suggest never entered my mind. I'll know better next time and thank you again. -- Regards, Alf Stockton www.stockton.co.za She is not refined. She is not unrefined. She keeps a parrot. -- Mark Twain My email disclaimer is available at www.stockton.co.za/disclaimer.html

« previous php.windows (#27720) next »