[PHP] Onclick event and PHP function

2006-02-15 Thread Alain Roger
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) {

Re: [PHP] Onclick event and PHP function

2006-02-15 Thread Richard Collyer
Hello, Your getting confused between server side and client side. PHP CANNOT be run on the client side which is what Javascript is. In this case all you are doing is calling that php function twice one for eng and once for fre. Instead try using mydomain.com/setlang?=eng as a link which calls

Re: [PHP] Onclick event and PHP function

2006-02-15 Thread Gerry Danen
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 [EMAIL

Re: [PHP] Onclick event and PHP function

2006-02-15 Thread tedd
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 I didn't realize that he was wanting

Re: [PHP] Onclick event and PHP function

2006-02-15 Thread Gerry Danen
Pretty much the same technique I am using, tedd. I may have even used your example as inspiration... :) At the top of each page, I use $currentstylecolor = isset( $_COOKIE['currentstyle'] ) ? $_COOKIE['currentstyle'] : brown; // brown = default style $currentstyle = /skins/style_ .