Jump to content

User Bann Script

Go to solution Solved by samowns,

Recommended Posts

  • Solution
	 i want to embed Bann Script or user deactive or active 
include "db.php";
	$name = mysqli_real_escape_string($a, $_POST['eml']);
$pass = mysqli_real_escape_string($a, $_POST['pass']);
$query=mysqli_query($a,"select count(*) as total_count from loginlogs where TryTime > $time and IpAddress='$ip_address'");
  //Checking if the attempt 3, or youcan set the no of attempt her. For now we taking only 3 fail attempted
    $msg="To many failed login attempts. Please login after 30 sec";
    //Getting Post Values
	$result=mysqli_query($a,"SELECT * FROM admin WHERE eml='$name' and pass= '$pass'");
	$row  = mysqli_fetch_assoc($result);
//ban user
  $_SESSION['user_name'] =$name;
  header("location:wel.php?msg=Scuessfull eml");
mysqli_query($a,"delete from loginlogs where IpAddress='$ip_address'");
        $msg="To many failed login attempts. Please login after 40 sec";
        $msg="<b>Please enter valid login details.<br/>$rem_attm attempts remaining <b>";
      mysqli_query($a,"insert into loginlogs(IpAddress,TryTime) values('$ip_address','$try_time')");
if(isset($_SESSION['user_name']) ){
  header("location:wel.php?msg=Scuessfull ");
<form  class="login-form" action="adminscure.php" method="post" >
<div class="message"><?php if($message!="") { echo $message; } ?></div>
<body id="LoginForm">
<div class="container">
<div class="main-div">
 <div class="panel">
   <h2>Admin Login</h2>
   <p>Please enter your email and passwords</p>
    <form id="Login">
<div class="form-group">
            <input type="name"  name="eml" class="form-control"  id="eml"  placeholder="name">
	        <div class="form-group">
	            <input type="password" name="pass" class="form-control" id="pass" placeholder="Password">
<input type="submit" name="sb" class="btn btn-primary">
 <div id="result"><?php echo $msg?></div>
	function getIpAddr(){
    if (!empty($_SERVER['HTTP_CLIENT_IP'])){
    }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
   return $ipAddr;


Edited by samowns
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.