You are here: Re: PHP table cell onclick « All PHP « IT news, forums, messages
Re: PHP table cell onclick

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация