PHP Classes

File: get_by_ip.example.php

Recommend this page to a friend!
  Classes of Kaurov Eugene  >  GET by IP  >  get_by_ip.example.php  >  Download  
File: get_by_ip.example.php
Role: Example script
Content type: text/plain
Description: php+oracle example to use get_bi_ip class
Class: GET by IP
Get the country of a IP querying a whois server
Author: By
Last change:
Date: 17 years ago
Size: 1,287 bytes


Class file image Download
if (is_file('./dbaccess.php')) {$pristavka="./";} elseif (is_file('./settings/dbaccess.php')) {$pristavka="./settings/";}
include_once (
include_once (

$today = getdate();
$click_today=ociparse($db,"SELECT sum(NCLICKS) as NCLICKS FROM VA_WW_COUNTER WHERE ipAddr='".$_SERVER['REMOTE_ADDR']."' and day='$today[mday]' and month='$today[mon]' and YEAR='$today[year]'");

if (

$stmt = ociparse($db,"UPDATE WW_COUNTER SET NCLICKS=NCLICKS+1 WHERE ipAddr='".$_SERVER['REMOTE_ADDR']."' and dtMake=trunc(sysdate)");
        include_once (
$ipdata=new get_by_ip($_SERVER['REMOTE_ADDR']);
/*echo $ipdata->host."<br>";
        echo $ipdata->netname."<br>";
        echo $ipdata->country."<br>";
        echo $ipdata->person."<br>";
        echo $ipdata->address."<br>";
        echo $ipdata->phone."<br>";
        echo $ipdata->email."<br>";*/
$stmt = ociparse($db,"INSERT INTO WW_COUNTER (Mainkey, dtMake, ipAddr, domain, countrycode, nClicks) Values (SEQ_WW_COUNTER.nextVal, trunc(sysdate), '".$ipdata->ip."', '".$ipdata->host."', '".$ipdata->country."', '1')");

For more information send a message to info at phpclasses dot org.