Login   Register  
PHP Classes

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: 8 years ago
Size: 1,347 bytes


Class file image Download
 * 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

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

//Set my IP address

//Compare IP addresses
if (!$def_attack->IsIpIdentity()) {
nl2br("Access deny!\n");
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");
nl2br("And you will be arrested. \n");
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 {
"Access allow";