Login   Register  
PHP Classes
elePHPant
Icontem

File: example_1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Todor Iliev  >  Defensive Attack  >  example_1.php  >  Download  
File: example_1.php
Role: Example script
Content type: text/plain
Description: IP address identity. Make ip allow or not.
Class: Defensive Attack
Retrieve information of current user HTTP request
Author: By
Last change:
Date: 7 years ago
Size: 1,347 bytes
 

Contents

Class file image Download
<?php
/**
 * File containing example 1(ip address identity) use DefensiveAttack.
 *
 * @package     DefensiveAttack
 * @version     1.0.0
 * @copyright     Copyright (C)2006 TheLordOfWeb. All rights reserved.
 * @license     http://www.gnu.org/copyleft/gpl.html GNU Public License
 * @filesource
 */

//Load class
//require("class.php4.DefensiveAttack.php");
require("class.php5.DefensiveAttack.php");

//Create object
$def_attack     =   new DefensiveAttack();

//Set my IP address
$def_attack->SetMyIpAddress("127.0.0.2");

//Compare IP addresses
if (!$def_attack->IsIpIdentity()) {
    print 
nl2br("Access deny!\n");
    
    print 
nl2br("I know your : \n\n");
    
    
//Get IP address
    
print nl2br("IP address: " $def_attack->GetIpAddress()  . "\n");
    
    
//Get host name
    
print nl2br("Host name: " $def_attack->GetHostName()  . "\n");
    
    print 
nl2br("And you will be arrested. \n");
    
    print 
nl2br("----------- Extra information for me ---------- \n");
    
    
//Get Referer
    
print nl2br(("Referer: " $def_attack->GetReferer() . "\n"));

    
//Get Input data
    
print nl2br(("Input data: " $def_attack->GetInputData() . "\n"));

    
//Get Cookie data
    
print nl2br(("Cookie data: " $def_attack->GetCookieData() . "\n"));

} else {
    print 
"Access allow";
}

?>