Re: Onclick event and PHP function
| From: | Gerry Danen | Date: | Wed, 15 Feb 2006 16:56:41 +0000 |
| Subject: | Re: Onclick event and PHP function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230452@lists.php.net to get a copy of this message | ||
Alain, have you tried cookies?
On http://www.lily-gallery.com/ you will see 2 colored
dots (bottom
left) that allows for alternate page colors. Once a user chooses one,
I remember his choice with a cookie. I use the cookie to control a
style sheet.
Gerry
On 2/15/06, Alain Roger <raf.news@gmail.com> wrote:
> Hi,
>
> I have some link on which if user click, should do the following things:
>
> - open a particular page
> - setup to sessions some particular variable value
>
> however, PHP function should be declared before HTML headers.
>
> so i was thinking about something like that
>
> <?php
> function vardef($lg)
> {
> ... store lg to my session variables ...
> }
> ?>
>
> <HTML>
> ...
> <A Href="none" Onclick="<?php vardef("eng")
> ?>">english</A>
> <A Href="none" Onclick="<?php vardef("fre")
> ?>">french</A>
> ...
> </HTML>
>
> but this does not work because my session variable is always setup to the
> last value (in this case "fre"), even if i click only on english :-(
>
> could you help me with this PHP issue ?
> thanks a lot,
>
> Alain