/    Sign up×
Community /Pin to ProfileBookmark

simple onclick counter

Hi,
I have reached a point in programing my web page where I think that PHP cant help me.
I need to count the amount of times someone clicks on 1 link. It is a big company and I offered them this link for free but in 6 months I want to be able to say how many people have clicked to them from my website.

I want to write a .txt file with a number on. I have no problem with creating a counter. The problem is that I have no idea of JavaScript and [SIZE=4]all I want is on the onClick it opens a new window with the page in AND adds 1 to the .txt file.[/SIZE]
Surely this is extremely simple for anyone who knows javascript?

I would be very grateful for anyone who can help.

Thanks

Jon

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonMay 18.2005 — JavaScript can't do that, it would have to be done with a server-side language. Your best bet would be to link to a .php script that increments the value in the .txt and then uses a server-side redirect to send them onto your site.
×

Success!

Help @jonki spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...