PHP Classes
elePHPant
Icontem

File: sIPb_Sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Uwe Stein  >  sIPb  >  sIPb_Sample.php  >  Download  
File: sIPb_Sample.php
Role: Example script
Content type: text/plain
Description: Demo file part 1
Class: sIPb
Block the IP address of undesired HTTP clients
Author: By
Last change:
Date: 10 years ago
Size: 1,047 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
  <title>sIPb-sample</title>
 
</head>
<body>

<br><br><br>
<div align="center">
<h2>This is a small demo of sIPb</h2>

<?php
include_once("./sIPb.php");
$ip = new sIPb;

if (isset(
$_GET["blockme"])) {
  
// block the ip during the next 10 seconds
  
$ip->blockIP(10);
?>
<h2>Now your IP is blocked for 10 seconds.<br>
       <A href="./sIPb_SamplePart2.php"> Klick here </A> during this
       time, to test sIPb without redirection<br>
       or <A href="sIPb_SamplePart3.php">here</A>
        to test sIPb with redirection
        <form >
           <input type="button" value = "Back" onclick="history.back()">
        </form>
<?php
 
}
 else {
 
?>

<h3>If you klick the button &#034;Block me&#034; your IP is blocked for 10 seconds</h3>

<br>
<form method="get" action="<?php echo $_SERVER["PHP_SELF"];?>">
   <INPUT type="submit" name="blockme" value="Block me">
 </form>
</div>
      
<?php
 
} ?>
</body>
</html>