<div align=center>
<form name="form1" method="post" action="b.php"> 
   <div align="center"> 
     <table border="1"> 
         <td width="120">Username :</td> 
         <td width="144"><input name="user" type="text" id="user"></td> 
         <td width="120">Mot de passe : </td> 
         <td width="144"><input name="password" type="text" id="password"></td> 
   <p align="center"> 
     <input type="submit" name="Submit" value="Enter"> 


file b.php

echo "<meta charset=UTF-8>";
if(isset($_POST["user"])&& isset($_POST["password"])&&isset($_COOKIE["attempts"])){
    echo "Welcome <b>".$_POST["user"]."</b> !<br/>";
    echo "Failed,bad username or password. ".$_COOKIE["attempts"]." attempt to log in.";
    return true;


I think I need to use another setcookie for the time that the user will be lock out of site for 10 minutes.
I just can't figure out how to to lock the page from the user for a limited time periode.
Can someone help me.

current time minus the time of the event. If the difference between these two is greater than or equal 10 minutes, you must set your user free.

Thanks for the info, the problem I don't even know how to get the current time.
I'm a newbie

can this $_SERVER['REQUEST_TIME'] do the job.
Sorry guys, I'll keep trying. I just can't find the solution.
I get what I want, but just can't find the loop to stop the access to the login page for a limited time.


here is a good tutorial on how it can be done without relying too much on session and cookie. If you need help in converting it to mysqli or PDO, please let us know.

thanks, by my goals here is to do this without mySQL.
Just with php. I'm trying to understand how to set a cookie and lock the page down with the cookie. Its pretty simple, but just can't find the solution.