Skip to content

Instantly share code, notes, and snippets.

@durbon
Created May 29, 2012 13:43
Show Gist options
  • Save durbon/2828446 to your computer and use it in GitHub Desktop.
Save durbon/2828446 to your computer and use it in GitHub Desktop.
login.php de ejemplo. fuerza brutal contra formularios
<?PHP
session_start();
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$usuario = "pedro";
$pass= "123456";
if(! ($_POST['username'] == $usuario && $_POST['password'] == $pass) )
{
Echo "<html>";
Echo "<title>MUY mal</title>";
Echo "<b>Acceso denegado</b>";
session_destroy() ;
return false;
}
else {
Echo "<html>";
Echo "<title>MUY bien</title>";
Echo "<b>Acceso concedido</b>";
session_destroy();
return true;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment