Jump to content

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

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.