add cadastro
This commit is contained in:
61
proteger.php
Executable file
61
proteger.php
Executable file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
session_start();
|
||||
// Se a senha ainda não foi validada, exibe o formulário
|
||||
if (!isset($_SESSION["acesso_liberado"])) {
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["senha"] === "banco*xcmg1") {
|
||||
$_SESSION["acesso_liberado"] = true;
|
||||
header("Location: " . $_SERVER["PHP_SELF"]); // Redireciona para evitar reenvio do formulário
|
||||
exit;
|
||||
}
|
||||
include "header.php"; // Inclui o cabeçalho da página
|
||||
|
||||
?>
|
||||
<style>
|
||||
section.flex {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
</style>
|
||||
<body class="p6 bg-gray-100" app="proteger">
|
||||
<section class="flex">
|
||||
<div class="flex flex-col items-center justify-center px-6 py-8 mx-auto md:h-screen lg:py-0">
|
||||
|
||||
<div
|
||||
class="w-full bg-white rounded-lg shadow dark:border md:mt-0 sm:max-w-md xl:p-0 dark:bg-gray-800 dark:border-gray-700">
|
||||
<div class="p-6 space-y-4 md:space-y-6 sm:p-8">
|
||||
<h1
|
||||
class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white">
|
||||
Acesso Restrito
|
||||
</h1>
|
||||
<form class="space-y-4 md:space-y-6" method="POST">
|
||||
<div>
|
||||
<label for="password"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Senha</label>
|
||||
<input type="password" name="senha" id="password" placeholder="••••••••"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
||||
required="">
|
||||
</div>
|
||||
|
||||
<button type="submit"
|
||||
class="w-full text-white bg-primary-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800">Sign
|
||||
in</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php
|
||||
exit; // Interrompe o carregamento da página até que a senha seja validada
|
||||
}?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user