Last active
November 25, 2019 17:45
-
-
Save pipethedev/8480808b1f1b47c5682e44d285210f13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
if(isset($_POST['verify'])){ | |
$code = filter_var_array($_POST['code'], FILTER_SANITIZE_STRING); | |
if($_COOKIE['code'] == $code){ | |
$result = "Successfull you will soon be redirected to your home page"; | |
}else{ | |
$result = "Incorrect Code"; | |
} | |
} | |
?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Verification</title> | |
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div class="bg-indigo-900 text-center py-4 lg:px-4"> | |
<div class="p-2 bg-indigo-800 items-center text-indigo-100 leading-none lg:rounded-full flex lg:inline-flex" role="alert"> | |
<span class="flex rounded-full bg-indigo-500 uppercase px-2 py-1 text-xs font-bold mr-3">Alert</span> | |
<span class="font-semibold mr-2 text-left flex-auto"><?PHP echo 'Enter the 6 digit code you recieved '; ?><br><?PHP echo $result;?></span> | |
<svg class="fill-current opacity-75 h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M12.95 10.707l.707-.707L8 4.343 6.586 5.757 10.828 10l-4.242 4.243L8 15.657l4.95-4.95z"/></svg> | |
</div> | |
</div> | |
<form class="w-full max-w-sm" method="post" action="validate.php" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"> | |
<div class="md:flex md:items-center mb-6"> | |
<div class="md:w-1/3"> | |
<label class="block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4" for="inline-full-name"> | |
Verification Code | |
</label> | |
</div> | |
<div class="md:w-2/3"> | |
<input class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500" id="inline-full-name" type="number" name="code" placeholder="123456"> | |
</div> | |
</div> | |
<div class="md:flex md:items-center"> | |
<div class="md:w-1/3"></div> | |
<div class="md:w-2/3"> | |
<button class="shadow bg-purple-500 hover:bg-purple-400 focus:shadow-outline focus:outline-none text-white font-bold py-2 px-4 rounded" type="submit" name="verify"> | |
Verify | |
</button> | |
</div> | |
</div> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment