Jump to content

[SOLVED] help with hit counter script


Reaper0167

Recommended Posts

I am looking to add the users ip to the hit counter as long it is not one of the two listed in the script. But I can not get this to work. Anyone?

<?php
include('config.php');
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "SELECT id FROM total_homepage_hits WHERE ip = '$ip' LIMIT 1";
$result = mysql_query($sql);
$count = mysql_num_rows($result);
$check = mysql_fetch_assoc($result);
$mark = $check['ip'];
if($mark != "***1****" or $mark != "*****2****")
{
   mysql_query("INSERT INTO total_homepage_hits (ip) VALUES ('$ip')");  // add ip to database if it is not one of the two listed in the if statement.
}
?>

Link to comment
https://forums.phpfreaks.com/topic/165274-solved-help-with-hit-counter-script/
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.