Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: click counter when link is pressed

  1. #21
    Join Date
    Feb 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    your page should be in php format to run this script
    just make a page in html and save it in php format

  2. #22
    Join Date
    Jul 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Script tweak required

    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">
    &nbsp;</p>


    <div align="center">


    &nbsp;</div>

    </body>

    </html
    Last edited by ipbr21054; 07-29-2010 at 12:52 PM.

  3. #23
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    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.
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  4. #24
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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!

  5. #25
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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
    Last edited by djr33; 01-26-2011 at 04:25 PM. Reason: Removed hotlink.

  6. #26
    Join Date
    May 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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/
    Last edited by jscheuer1; 05-09-2012 at 04:08 AM.

  7. #27
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Stuck with similar problem yet differently

    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!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •