Forum Moderators: DixonJones

Message Too Old, No Replies

Counters

         

Adam5000

4:49 am on Apr 3, 2005 (gmt 0)

10+ Year Member



Hello everyone. It's great to find people like myself who enjoy building web pages. I'm getting back into programming after a long layoff. Does anyone remember a language called BASIC? That's the one I started with and it goes with a printer that had a steel rod about three feet long and about three inches across, spining at high speed, with raised characters on it to print the letters. The printer itself weighed at least 100 pounds.

But back to the present.

I learned the basics of HTML about 5 years ago but never really did anything with it until now.

And now I'm working on Javascript (which I think makes HTML seem easy) and although it would make things eaiser if I knew it all, I fall just a LITTLE bit short of that.

I'm starting to get comfortable with the basics of Javascript and I'm getting ready to add some more things to the site I've just made. And one of the things I'd like to have is a counter on the home page to tell me how many times the site has been visited.

Would someone tell me the basics on how that works? And by that I mean, what does the counter key on? or how does the counter know when the site has been visited?

Right now I'm thinking it has something to do with leaving a cookie on the visitors hard drive.

Again greetings and it's good to find a group of cool people who, like myself, enjoy building web pages.

ogletree

5:02 am on Apr 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just type javascript counter into google there are lots of examples out there.

Adam5000

3:44 pm on Apr 3, 2005 (gmt 0)

10+ Year Member



Thank you Ogletree. I haven't had a chance to explore the search results very much yet but it looks like a good place to start. There are bunches of people offering to do it all for me (put a counter on my site, keep track of all the visitors....) all for free, but that's not what I want. I want to understand how everything works.
And the search you recommended looks like a good place to start.

<html>
<head>
<title>Reply to Ogletree</title>
</head>

<body>

<script language="javascript">
<!--

window.document.write("Thanks again Ogletree and I appreciate your help.")

//-->
</script>

</body>
</html>

mikeyb

11:21 am on Apr 4, 2005 (gmt 0)

10+ Year Member



Hi Adam,

You will need something a little more than javascript to put a counter on your web page.

Javascript is run at the client, by their web browser, so any counting it does, will only count their own visits and no one elses, and you will not be able to see the count yourself as javasscript cannot store info on your server, only as you say in cookies.

To do a counter you will need some kind of server side scripting, either ASP, PHP, Perl etc.

Adam5000

3:45 am on Apr 7, 2005 (gmt 0)

10+ Year Member



Thank you for your help Mikey.

For now I think I will farm that job out. At least until I have a chance to learn a little more about how to do it. Right now I've got a bunch of irons in the fire. Counters and customer tracking are on my "To do" list.