Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    script needs a little tweak

    Hi,
    I have a script that i need a little tweak to.
    If you are able to write script then it should be very easy for you.
    I obviously dont and asking for your help.
    The script below is for a click counter which the hypertext link then opens up another web page.
    I am using this script to find out how many people look at this other page.
    My problem is that it does not keep a record of the hits etc.
    Once you close the browser the next time you look at the results which a box is shown next to the link it reads 0 again.
    Below is the script in question.
    Thanks

    <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

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,313
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), communicate with the server, access a database, the client's operating system or the Windows registry, or alter the default behaviour of the browser.

    You can only do what you wish using server-side scripting.

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

  • #3
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks
    server-side scripting do you think that is something i could do as i only no next to nothing.
    I thought that it was just a matter of adding a line of text ?

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,313
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    Quote Originally Posted by ipbr21054 View Post
    Thanks
    server-side scripting do you think that is something i could do as i only no next to nothing.
    I thought that it was just a matter of adding a line of text ?
    As you no (sic) next to nothing, then the answer must be no.
    Presumably you would not attempt to service or repair a machine or appliance without any experience or understanding of how it worked.

    Google for hit counters.
    Last edited by Philip M; 07-29-2010 at 08:37 PM.

  • #5
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i am always willing to learn and have got on in life ok by doing that

    i thought it was a matter of downloading something,setting it up and tell it what link/page to monitor ?

  • #6
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,313
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    Quote Originally Posted by ipbr21054 View Post
    i am always willing to learn and have got on in life ok by doing that

    i thought it was a matter of downloading something,setting it up and tell it what link/page to monitor ?
    Sure. Just like driving a car is just a matter of pressing the pedals and turning the steering wheel.

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,664
    Thanks
    80
    Thanked 4,643 Times in 4,605 Posts
    LOL! Nice analogy.

    *Probably* somebody indeed has such a counter script available. Probably written in PHP. And if you can figure out how to fill the car with gas and turn the ignition key, the *probably* you can install the script and get it to work. Just watch out for the stop signs.

    Try googling for such a script.

    Oh...but first make sure that the server you are using supports PHP. If it doesn't, then you'll need a different server or a different server-side system. Kind of like making sure you aren't using an American car on British roads.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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