Page 1 of 1

[SOLVED]php and events

Posted: Fri Sep 17, 2004 6:51 am
by grammic
Hi again.

Is there any way to increase a variable in php on an event such as onclick;
What I need is a global variable to count how many links were chosen by a user during a session in a site. Is that possible;

Posted: Fri Sep 17, 2004 6:53 am
by dethron
You should reload the page, because PHP is server side :)

Posted: Fri Sep 17, 2004 7:00 am
by grammic
So if I reload the page what happens to what;
I mean where do I declare a global variable and how does it get increased;
I want that to happen when a user chooses a link.

Posted: Fri Sep 17, 2004 7:12 am
by dethron
- send the page to itself with a variable. (not to real link)
- read the value of the variable and get the idea that where the page should go.
- increment your session variable
- redirect the page. (to real link)

Posted: Fri Sep 17, 2004 7:14 am
by grammic
Ok thanks!