Click to See Complete Forum and Search --> : Links Counter
Forbidden
03-27-2004, 07:22 AM
Hello, I dont know is this is a scrpit or what.
When some one clicks on your link, is there a way to see how many people have cliked on that link in that day.
www.clan-rel.tk My website
buntine
03-27-2004, 07:46 AM
First of all, get a new host! Those popup adds will drive everyone away from your site..
Theres two ways..
1) You could write a javaScript which writes to a text file. The file could simply contain an integer which is incremented. You could run the script everytime a link is clicked using the onclick event.
2) you could use a server-side language which logs the data to a database each time a page loads.
Regards,
Andrew Buntine.
steelersfan88
03-27-2004, 09:00 AM
but since javascript can't directly, nor was meant to, write to text files, this will require the use of an activeX object.
Forbidden
03-27-2004, 09:47 AM
Thanks for your adivce guys.
Do you know where I could get this javascript from, beacuse I am rubbish at this stuff.
"You could write a javaScript which writes to a text file. The file could simply contain an integer which is incremented. You could run the script everytime a link is clicked using the onclick event"
buntine
03-27-2004, 01:02 PM
I think it would be best to do it from the server. So each time a page loads, the database is updated.
This will also allow for easier viewable and editable data.
The only drawback -- this will only work for local links. So if you had a link to google.com, the link counter wont record it.
If you want to use this method, find out which server side languages your server supports and then post your details in the corresponding forum..
Some languages include; ASP, CGI, PHP, ColdFusion, ASP.NET.
Regards,
Andrew Buntine.
steelersfan88
03-27-2004, 01:35 PM
the other drawback, if you record the numbe rof times the page unloads, there could also be some discrepencies.
buntine
03-27-2004, 02:32 PM
What discrepencies would be caused?
steelersfan88
03-27-2004, 02:40 PM
well, for example; users who encounter errors with other windows that cause all browsers to shut will not be tracked; users who disconnect fro mthe Internet while browsing would also not be tracked.
buntine
03-28-2004, 01:55 AM
Fair enough..
The best way is to have every link directed towards the same page. Have each link use a different queryString variable which selects the correct page URL from a database and increments a table field to show that someone has clicked the link..
Thats how it is done in the commercial CMS world.
Regards,
Andrew Buntine.