Jump to content

help on hit counter


pixeltrace

Recommended Posts

guys,

i need help on this.
kindly check
[a href=\"http://www.sinagtala.net/sinag3\" target=\"_blank\"]http://www.sinagtala.net/sinag3[/a]
notice the hit counter on the upper right corner
whenever i go to the other page it adds up again.
what i wanted to happen is that it will just hit on the index page
and not on the subpages anymore
this is my script for the index page and the other subpages.

========= this is the script that i placed on the first 3 lines of each page
<?php
session_start();
?>
=========
========= i just include the counter.php on every page
<? include 'counter.php'; ?>
=========
========= this is the script that's in the counter.php
<?php

$counter_file = ("counter.txt");
$visits = file($counter_file);

if(!session_is_registered(session_id()))

{
$visits[0]++;
}

$fp = fopen($counter_file , "w");

fputs($fp , "$visits[0]");


fclose($fp);

echo "$visits[0]";

session_register(session_id());
?>
==============

hope you guys can help me with this.

thanks!
Link to comment
Share on other sites

  • 2 years later...
[quote author=pixeltrace link=topic=86816.msg349362#msg349362 date=1140897524]
guys,

i need help on this.
kindly check
[a href=\"http://www.sinagtala.net/sinag3\" target=\"_blank\"]http://www.sinagtala.net/sinag3[/a]
notice the hit counter on the upper right corner
whenever i go to the other page it adds up again.
what i wanted to happen is that it will just hit on the index page
and not on the subpages anymore
this is my script for the index page and the other subpages.
[/quote]

Your website does'nt exist.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.