icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old June 25th, 2003, 12:43 AM   #1 (permalink)
Registered User
Comfy Contributor
 
Joined in Jun 2003
Lives in Nice California
263 posts
Gave thanks: 0
Thanked 0 times
Thumbs up

I'm having a little problem with the counter script. I can install counters just fine by using the basic script and inserting my domain name and the page name, for instance:
<IMG SRC="/cgi-sys/Count.cgi?df=clearlakefishing.com-index.html&DD=E&RELOAD=N" VSPACE="0" HSPACE="0" BORDER="0">

My problem is that I would like to reset my counters to 0 whenever I wish and can't figure out how to do so. I'm aware of the reset box:

Edit/Reset a Counter
Counter Name (no .dat): catfish
New Count: 0
Commit Changes


but it doesn't seem to accept any name except my username. I want to be able to have several pages with counters on them and be able to reset them.

Could it be that because I'm not on a static IP, it will only work with my username and therefore the only way I can have more than one page with counters is by manually changing the HTML?
__________________
Catfish Ed
http://www.catfished.com
Reseller server: dime13
catfished is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old June 25th, 2003, 8:37 AM   #2 (permalink)
Registered User
Comfy Contributor
 
Joined in May 2003
Lives in ISREAL
258 posts
Gave thanks: 0
Thanked 0 times
[font=Arial][font=Arial][font=Arial]
Quote:
<?
$counterfile = "counter.dat";

$opencount = fopen($counterfile,"r");
$currentcount = fread($opencount, filesize($counterfile));
fclose($opencount);

$newcount = $currentcount;
++$newcount;

$opennewcount = fopen($counterfile,"w");
fwrite($opennewcount, $newcount);
fclose ($opennewcount);
?>

<html>
<head>
<title>yoursitetitle</title>
</head>

<table width="60" border="1" cellspacing="0" cellpadding="0">
&nbsp; <tr>
&nbsp; &nbsp; <td align=center><font color="#000000"><strong><? echo $newcount ?></strong></font></td>
&nbsp; </tr>
</table>

</body>
</html>
The above is a very simple counter I wrote, its in php...

basicly all you need to do is to edit your index file by adding to it what I wrote above and renaming it to index.php instead of index.html or what ever.
step 2:
and you need to make a file called "counter.dat".
all you have to write in that file is 0.
step 3:
now upload both files to your site...

some info:
the "counter.dat" file is the number of visits you got, when ever you want to reset it to 0, just delete the number thats there and type 0.

let me know if you like it

P.S.
if you want a diffrent counter for each page, just add the code I gave you to the page you want the counter to be on and change
Quote:
$counterfile = "counter.dat";
to
Quote:
$counterfile = "yourpathtoadifferentcounter.datfile/counter.dat";
websterworlds.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old June 28th, 2003, 9:27 AM   #3 (permalink)
Surpass Fan
Comfy Contributor
 
MsCatEyes's Avatar
 
Joined in May 2003
Lives in Mountains of Colorado
Hosted on Sky & D9
102 posts
Gave thanks: 0
Thanked 0 times
Hey, I plan on trying it and I'm sure it'll work! Thanks for sharing...



+grins+
__________________
Cat
~~~~~~~~~~~~~~~~
"Probably just chasing my tail again..."
MsCatEyes is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old June 28th, 2003, 9:30 AM   #4 (permalink)
Registered User
Comfy Contributor
 
Joined in May 2003
Lives in ISREAL
258 posts
Gave thanks: 0
Thanked 0 times
Wink

thanks cat! let me know if its good...
websterworlds.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old June 28th, 2003, 2:01 PM   #5 (permalink)
Registered User
Comfy Contributor
 
Joined in Jun 2003
Lives in Nice California
263 posts
Gave thanks: 0
Thanked 0 times
Unhappy

I'm sorry but I didn't try it out yet. I'm still trying to figure out how to reset the ones I'm using. I've used that script (the one that C Panel provides) for years and it's easy to use except the way C Panel has it set up I can't reset the counters.

Thank you very much for sharing your script websterworlds.com. I will try it eventually and give you my opinion.
__________________
Catfish Ed
http://www.catfished.com
Reseller server: dime13
catfished is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On