Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of ashwin suresh morey  >  Web Tracker  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example file
Class: Web Tracker
Track site user accesses with a MySQL database
Author: By
Last change:
Date: 8 years ago
Size: 750 bytes
 

Contents

Class file image Download
<?php
    
include("db_connect.php");
    include(
"web_track.php");
    
$webConn = new tracker();
    
$ipAddress $webConn->ipAddress;
    
$postDate $webConn->postDate;
    
$postTime $webConn->postTime;
    
$dbConn = new database();
    
$dbConn->query("select * from tb_ipaddress");
    if(
$dbConn->num_rows()>0){
        while(
$dbConn->movenext()){    
            
$dbIP $dbConn->getfield("ipID");
            
$dbIpAddress $dbConn->getfield("ipAddress");
        }
    }
    if(
$dbIpAddress != $ipAddress){
        
$dbConn->query("insert into tb_ipaddress (ipaddress, postDate, postTime) values('$ipAddress','$postDate','$postTime')");
    }
    else{
        
$dbConn->query("update tb_ipaddress set ipAddress = '$ipAddress', postDate = '$postDate', postTime = '$postTime' where ipID = '$dbIP'");        
    }
?>