[SOLVED]php and events

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
grammic
Forum Newbie
Posts: 19
Joined: Wed Sep 15, 2004 12:27 pm

[SOLVED]php and events

Post 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;
Last edited by grammic on Tue Sep 21, 2004 6:40 am, edited 1 time in total.
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

You should reload the page, because PHP is server side :)
grammic
Forum Newbie
Posts: 19
Joined: Wed Sep 15, 2004 12:27 pm

Post 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.
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post 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)
grammic
Forum Newbie
Posts: 19
Joined: Wed Sep 15, 2004 12:27 pm

Post by grammic »

Ok thanks!
Post Reply