Source for file example_5.php
Documentation is available at example_5.php
* File containing example 5(check referer with "www" and without "www") use DefensiveAttack.
* @package DefensiveAttack
* @copyright Copyright (C)2006 TheLordOfWeb. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
//Load class DefensiveAttack
require
("class.php5.DefensiveAttack.php");
* MyDefensiveAttack class for php 5.x
* @package MyDefensiveAttack extends by DefensiveAttack
* @author TheLordOfWeb <http://thelordofweb.atspace.com/>
* @copyright Copyright (C)2006 TheLordOfWeb. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* My host name 2 with "www" or not
* MyDefensiveAttack constructor
* @see parent::__construct()
parent::__construct($myHostName);
$pos =
stripos($this->mMyHostName,'www.');
$this->mMyHostName2 =
(false !==
$pos AND 0 === (int)
$pos) ?
substr($this->mMyHostName,4) :
"www." .
$this->mMyHostName;
* Check referer for my url address with "www" and without "www"
return (strcmp($this->mMyHostName,$this->mReferer) ==
0 OR strcmp($this->mMyHostName2,$this->mReferer) ==
0) ?
true :
false;
//Check referer if I do not want direct access to my site
print
"Access deny " .
'<a href="example_5.php" >Use link</a>';
Documentation generated on Wed, 01 Nov 2006 00:00:00 +0200 by phpDocumentor 1.3.1