Counter on a webpage

I want to add a counter using code only, not linked off another sites page. I have my server and my site, mike-site.us and I have our Robotics Team site and FLL Team all on the same server. I would like to add the counter to each of them, I have frontpage 2000 and have Windows 2003 Server on the server with the Frontpage extensions installed on it. On a page I use as my homepage when I start firefox home page I have at the bottom the code where its supposed to be but its not working. Anyone have any Ideas?

Also, I would like to setup video sharing for FIRST videos like SOAP does on their site. Kinda as a mirror, I might have to talk to someone on there to make it even easier or official. I have enough space and decent bandwith, I’m on sDSL so not worried about upload speed. Just unsure as to an easy way. I have on my site an Idea using FTP but like how their site is setup.

Thanks,
Mike Aalderink
Team 1654

I don’t have much experience in Frontpage, but are you sure the extensions are enabled on your server? What is shown on your front page right now seems to be just some text that says “[Hit Counter]”, like something you would see in Frontpage before publishing it to a Frontpage enabled server.

Also, try a different server to test if it’s the code’s fault, or if it’s the server’s problem.

If you just uploaded the file to your server using FTP and didn’t publish the page using the Frontpage Server Extensions or SharePoint Services, that could be the cause of the problem. If you are using Frontpage 2003, make sure you have the correct option selected in the “Remote Web Site Properties” dialog box.

From the Frontpage help file:

Remote Web Site Properties
By using the Remote Web Site Properties dialog box, you can specify how you want to publish files and folders from the Web site that is currently open in Microsoft FrontPage to another location. This process is also referred to as publishing from the local Web site to a remote Web site. The dialog box provides options on the following tabs.

Remote Web Site tab

Remote Web server type
Under Remote Web server type, click the type of server that hosts the remote Web site.

FrontPage or SharePoint Services

If the Web server runs FrontPage Server Extensions from Microsoft, SharePoint Team Services v1.0 from Microsoft, or Microsoft Windows SharePoint Services, enter information about the server in the following boxes.

Remote Web site location Type the Internet address, including the protocol, of the remote Web site that you want to publish and files and folders to— for example, http://www.example.com— or click Browse to locate the site.

Just a side question…

I noticed that you are running Apache on MS Windows. That is a niche configuration, but one I have found to be excellent and very usable. My site, endeavour.zapto.org, is also running Apache 2.0.52 under Windows.

But how on earth did you manage to make Frontpage extensions work with Apache on Windows? I have tried all varieties of black, white, and grey-ish magic to get it to work and I have failed each time.

OK, if you have MySQL. Go into phpmyadmin, make a database (or you can use a pre-existing one), make a table called “hits”, in that table have fields:
IP: Varchar(25)
time: Int(14)

On your home page, put this code


<?php

	// connect to our mysql server, and select the database
	mysql_connect("localhost", "mysql_username", "mysql_password");
	mysql_select_db("your_db_name");

	// get the amount of page views
	$sql	=	mysql_query("SELECT * FROM `hits`");
	$views	=	mysql_num_rows($sql);

	// get the amount of unique views
	$sql	=	mysql_query("SELECT DISTINCT(IP) FROM `hits`");
	$unique	=	mysql_num_rows($sql);

	// get the first hit
	$sql	=	mysql_query("SELECT * FROM `hits` ORDER BY `time` LIMIT 1");
	$first	=	mysql_fetch_array($sql);

	// add this hit
	$sql	=	mysql_query("INSERT INTO `hits` (`IP`, `time`) VALUES ('".$_SERVER'REMOTE_ADDR']."', '".time()."')");

	// display text
	echo "There has been ".number_format($views)." page views since ".date("F j, Y", $first'time'])."<br>";
	echo number_format($unique)." of those were unique hits.<br>";

?>

IM me if you need more help (MikeWasHere05)

Well, since I cant exactly get the simplest thing like a counter working it seems it might not be working. I am running 2003 server. But yeah everything else is working flawlessly. before I repartitioned my HD and reinstalled (after finding out my XP Pro licence was used up ??!!!??) I had run for 83 or so days since last restart. Then a few days ago a bad power supply, but its back on for good hopefully ready to take on my task of gigs of video.

sounds like what I want to do. I guess I’ll download and install Mysql tomorrow. I just got on to check for any other ideas. Still havent gotten it to work, but didnt have much chance.