Ip counter

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Ip counter

    Please anyone can help me to create a code that count all the Unique IP visitor for a site?

    #2
    Well bro. If u use lavalair based website then u must have a directory of user logs. .ex: ursite.com/logs . .there u can see lot of .txt files.thatz all. Thanx for using coding talk.stay here learn more and explore minds. .

    ..In logs directory u can see user agents,ip,passwords..

    Comment


      #3
      Sql
      PHP Code:
      CREATE TABLE `user_ips` (
        `
      idint(100NOT NULL auto_increment,
        `
      ipvarchar(30NOT NULL default '',
        
      PRIMARY KEY  (`id`),
        
      UNIQUE KEY `ip` (`ip`)
      ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=
      php:
      PHP Code:
      $ipcount mysql_fetch_array(mysql_query("SELECT id FROM user_ips WHERE ip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."'"));
      if(
      $ipcount[0]<1){
      mysql_query("INSERT INTO user_ips SET ip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."'");
      }
      $ipcount mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM user_ips"));
      print 
      $ipcount[0].' Unique Visitors'

      Comment


        #4
        S0mthing else bro rockzz.thank u.

        Comment


          #5
          PHP Code:
          $ip=mysql_fetch_array(mysql_query("SELECT ip FROM ips WHERE ip='".$userip."'"));
          if(
          $ip[0]>1){
          echo 
          "fraud click";
          }
          else {
          echo 
          'unique click';

          Comment


            #6
            Originally posted by something else View Post
            PHP Code:
            $ip=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ips WHERE ip='".$userip."'"));
            if(
            $ip[0]>1){
            echo 
            "fraud click";
            }
            else {
            echo 
            'unique click';

            oops updated it ^^^

            Comment

            Working...
            X