your page should be in php format to run this script
just make a page in html and save it in php format
Printable View
your page should be in php format to run this script
just make a page in html and save it in php format
Hello,
I am new here and would like some help if i could ask please.
I am using the script below which is a click counter to tell me how many peolple visit a site once the hypertext link is clicked on.
The problem i have with it is that it does not keep the recorded hits correctly.
If i click on the link 10 times then 10 is shown in the result box which is on the screen but as soon as i close the browser and then open it again the 10 hits that were shown in the box now show 0.
Could somebody edit the script so every time the page has been visited the results will update and stay recorded each time.
Thanks very much
<HTML>
<HEAD>
<TITLE> Clicker Counter Thingamajig </TITLE>
<script type="text/javascript">
var clicks = 0;
function linkClick(){
document.getElementById('clicked').value = ++clicks;
}
</script>
</head>
<body>
<a onclick="linkClick()" href="http://www.connells.co.uk/detail.asp?type=0&src=property&cs=88&bs=WOT&br=-1&prop=100003&min=150000&max=-1&bed=3&page=6&id=WOT302735">CLICK HERE</a>
clicked <input id="clicked" size="3" onfocus="this.blur();" value="0" > times.
</BODY>
</HTML>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<title>About Me</title>
</head>
<body bgcolor="#FFFFFF">
<p align="center">
</p>
<div align="center">
</div>
</body>
</html
Thats because it's client side, If you want javascript to remember it, you can use cookies; there are PLENTY of tutorials on the internet for that.
Hi there, I stumbled across this forum whilst trying to find a way of craeting a click counter.
This may seem like a daft question, but is there a way of having another link that would decrease the number displayed?
Is it also possible to create a link that would plus/minus by larger increments (i.e.) ten?
I am very new to all this and would very much appreciate the help!
Hey there!
I have developed an download and click counter, too!
My counter is in the new and modern facebook style but can be styled as you wish.
Maybe you have to translate the page via the google translator.
http://www.ka-mediendesign.de/blog/click-und-download-counter-fuer-links/
Example are in this article, too.
This counter were programmed in javascript an php.
When everything is running you just have to give the link the class "downloadCounter" an the counter appears and counts! :)
I hope you understand everything.
Best regards,
caom
Not sure if anyone can still help but I am looking for a click counter that keeps track of the clicks made even after navigating to another page. I do not want it to restart at 0. Please let me know if you can help, my job depends on it! :-/
http://www.ka-mediendesign.de/blog/click-und-download-counter-fuer-links/
Hi, I have everything working according to the steps i have read here in order to create two buttons (Rollover in Dreamweaver HTML) which increment the counter by 1. Unfortunately, they increment each others counters despite the fact that I have two distinct php files, named differently and two txt files also named differently from one another. i am unsure what code to supply but here is the rollover code...
<a href="Vote.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('VoteObama','','images/ObamaSelected.png',1)"><img src="images/ObamaVote.png" alt="Vote for Obama" name="VoteObama" width="280" height="280" border="0"><?php include 'VoteCounter.php';file_put_contents('counter.txt', ((int) file_get_contents('counter.txt')) + 1); ?></a>
<a href="Vote.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('VoteRomney','','images/RomneySelected.png',1)"><img src="images/RomneyVote.png" alt="Vote for Romney" name="VoteRomney" width="280" height="280" border="0"><?php include 'VoteCounterRomney.php';file_put_contents('counterRomney.txt', ((int) file_get_contents('counterRomney.txt')) + 1); ?></a>
Any help is greatly appreciated!