PHP Classes
elePHPant
Icontem

File: example_4.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_4.php  >  Download  
File: example_4.php
Role: Example script
Content type: text/plain
Description: Smart cookie trick. Ban with cookie.
Class: Defensive Attack
Retrieve information of current user HTTP request
Author: By
Last change:
Date: 8 years ago
Size: 1,240 bytes
 

Contents

Class file image Download
<?php
/**
 * File containing example 4(Ban cookie trick) 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();

//Get option
$safe_option = (isset($_GET['op'])) ? intval($_GET['op']) : 0;

switch (
$safe_option) {
   
   
//Check ban
   
case 1:
        if (
$def_attack->IsSetSmartCookieBan()) {
            print
"You are banned. <a href='example_4.php?op=2' >Delete ban</a>";
        } else {
            print
"You are not banned. <a href='example_4.php' >Go for ban</a>";
        }
        break;

   
//Delete ban
   
case 2:
       
$def_attack->DelSmartCookieBan();
        print
"You are unbanned. <a href='example_4.php' >Go for ban</a>";
        break;

   
//Set cookie ban
   
default:
       
$def_attack->SetSmartCookieBan();
        print
"You will be banned. <a href='example_4.php?op=1' >Check ban</a>";
        break;
}


?>