...

View Full Version : script needs a little tweak



ipbr21054
07-29-2010, 07:46 PM
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

Philip M
07-29-2010, 08:07 PM
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.

ipbr21054
07-29-2010, 08:21 PM
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 ?

Philip M
07-29-2010, 08:30 PM
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. :p
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.

ipbr21054
07-29-2010, 08:37 PM
i am always willing to learn and have got on in life ok by doing that :p

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

Philip M
07-29-2010, 08:45 PM
i am always willing to learn and have got on in life ok by doing that :p

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. :D

Old Pedant
07-29-2010, 09:00 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum