Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Mohammed Cherkaoui  >  Login Ban  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example file
Class: Login Ban
Keep track and ban failed user access attempts
Author: By
Last change:
Date: 2010-03-24 08:02
Size: 650 bytes
 

Contents

Class file image Download
<?php
ob_start
();


// |L|ogin |B|an
require('lb.class.php');

$LB = new Login_Ban('3''15');// 3 is the limit attemps & 15 is the ban time (Minutes)


// Checking

if($LB->Banned())
{
die(
'You have use all attempts');
}

?>
<form method="post" action="?do=Login">
Name : <input type="text" name="username"><br />
<input type="submit" value="Go !!">
</form>
<?php

if($_GET['do'] == 'Login')
{
$Name 'Mohammed';
if(
$_POST['username'] != $Name)
{
echo 
'Attemp failed';
$LB->Set_Attemp();
} else
{
echo 
'Succed !!';
}
}

// if you wan't to delete all cookies Use the function :
/*
$LB->mkempty();
*/



?>