|
Posted by Rik on 07/19/07 13:32
On Thu, 19 Jul 2007 15:27:49 +0200, screechyboy@googlemail.com =
<screechyboy@googlemail.com> wrote:
> when they click on a cell in my table i would like to redifine a
> variable in php.
>
> So...
>
> <td onclick=3D"<?php $color=3D"White" ?>"></td>
> <?php echo $color ?>
>
> it doesnt wait for onclick before running the PHP so as soon as i load=
> the page its prints White.
>
> I hope you can see what im trying to do... any help would be greatly
> appreciated!
PHP is server-side, not client-side. It sends a page 'as is', and can on=
ly =
perform actions on the server itself. It doesn't care you have set it in=
=
an 'onclick' HTML attribute, it could care less by what random content i=
t =
is surrounded. It builds a page and sends the result to the user.
You probably want javascript for this, something that does run on the =
client's computer.
-- =
Rik Wasmus
[Back to original message]
|