Jump to content

[SOLVED] Counter help


Vivid Lust

Recommended Posts

I need some beginner's php help on a counter which only says: array :s

 

here's my coded:

 

Counts:

<?php
$count_my_page = ("hit.txt");
$hits = file($count_my_page);
$hits = $hits ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits");
fclose($fp);
?>

Resets:

<?php
$count_my_page = ("../hit.txt");
$hits = file($count_my_page);
$hits = "0";
$fp = fopen($count_my_page , "w");
fwrite($fp , "$hits
");
fclose($fp);
?>

 

Thanks in advanced if someone can help!

 

Link to comment
https://forums.phpfreaks.com/topic/116054-solved-counter-help/
Share on other sites

What are you wanting this counter to do?

I coded one that has intelligence based - behind it..

 

It counts up 1 for every visitor that visits the site, but then records that users IP address in a database, so if they ever come back to the site again using that computer - the counter doesnt go up by 1, it just stays the same...

 

I can post the code and explain it, if youd like

Link to comment
https://forums.phpfreaks.com/topic/116054-solved-counter-help/#findComment-596774
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.