# Link Click Counter - PHP / MYSQL? Help PLease



## r3drock3t88 (Jan 13, 2007)

Hey all,

I want something very simple here, or at least the idea is simple. What I want is basically a link counter that does the following...

I will have two links, "Link one" and "Link two". If someone clicks on either of the links, I do not want the current page to change at all. I simply want a counter to be incremented by one. So for example, say 

"Link one (22) | Link two (17)" 

The above numbers are the current link count per link. Now, say someone clicks "Link one (22)" ... What I would love to have happen is "Link one(22)" now becomes "Link one(23)", but we stay on the current page (preferably without a refresh, but I don't know if that's doable).

Hopefully that is explained well enough! I am not sure what language would be best for this, php / mysql or javascript and a text file ... 

Thank you all in advance! Any help is much appreciated.

- Sam


----------



## TBH-LSVC (Aug 5, 2008)

I didn't understand much, but I think you mean making dynamic pages using javascript in which you can make a page that have parts updated instantly without refresh without updating the whole page.


----------



## r3drock3t88 (Jan 13, 2007)

Hello,

Thanks for the reply! Yes, that would be a big part of the problem, having it refresh without updating the entire page.

I actually found a great example of this at fmylife.com ... the way they have their voting setup is pretty much exactly how I would love mine to be. It says

"I agree, your life is f**ked" OR "Your deserve that one" ... the user can then click one of the links, and it adds 1 to the total amount of people who voted, without refreshing the entire page.


Thanks in advance again for your help!


----------



## TBH-LSVC (Aug 5, 2008)

hey again. A new idea came to my mind . Perhaps you can make a flash file and embed it into the webpage; in this file you put a voting poll ( same idea as link counter ) such that flash is dynamic and updated in frame. Then you set the voting flash script to redirect the user when he voted to another poll depending on the link he chose to vote. Here's a voting poll (flash & XML) coded in macromedia flash CS3 and inframe updated, but you need to create an account to download it (free). http://www.flabell.com/flash/XML-Flash-Voting-Poll-39


----------



## TBH-LSVC (Aug 5, 2008)

I found another one: a link counter (not a voting poll). This one is AJAX/PHP but I guess that it is not dynamic though it contains javascript but I haven't taken a look at the script yet. http://www.phpclasses.org/browse/package/2838.html#download


----------



## r3drock3t88 (Jan 13, 2007)

Hey again!

Thanks for all your responses. I am not very familiar with flash, and would love very much if I could have this done using javascript or PHP / MYSQL, or both! I took a look at the link you sent, that is a very cool counter, but I am looking more for something that is textual based, rather then visually.

Thanks again though for your help, it's much appreciated!


----------

