write-ups-challenges-2019-2020/Padlock/index.php

71 lines
2.1 KiB
PHP
Raw Normal View History

2022-11-24 21:43:03 +00:00
<?php
$fu = False;
if (isset($_COOKIE["fu"])) {
$fu = True;
}
if (isset($_GET['try'])) {
$fa = intval($_GET['try']);
}
$fa100 = floor($fa / 100);
$fa -= 100 * $fa100;
$fa10 = floor($fa / 10);
$fa -= 10 * $fa10;
$fa1 = $fa;
?>
<!DOCTYPE html>
<html>
<head>
<title>This page is locked</title>
<meta name="author" content="BenjaminVer">
<link rel='shortcut icon' href='assets/lock.png'>
<link type='text/css' rel='stylesheet' href='CSS/main.css'/>
<?php if (isset($_GET['try'])) { echo "<style> .w {color: red;} </style>"; } ?>
<script type='text/Javascript' src='script/jQuery.js'></script>
<script type='text/Javascript' src='script/main.js'></script>
</head>
<body>
<div class='full'>
<table>
<tr>
<?php if ($fu == True) {
echo "<td><div class='triangle up' id='1000up'></div></td>"; }
?>
<td><div class='triangle up' id='100up'></div></td>
<td><div class='triangle up' id='10up'></div></td>
<td><div class='triangle up' id='1up'></div></td>
</tr>
<tr>
<?php if ($fu == True) {
echo "<td class='digit w' id='num1000'>0</td>"; }
?>
<td class='digit w' id='num100'><?php echo $fa100; ?></td>
<td class='digit w' id='num10'><?php echo $fa10; ?></td>
<td class='digit w' id='num1'><?php echo $fa1; ?></td>
</tr>
<tr>
<?php if ($fu == True) {
echo "<td><div class='triangle down' id='1000down'></div></td>"; }
?>
<td><div class='triangle down' id='100down'></div></td>
<td><div class='triangle down' id='10down'></div></td>
<td><div class='triangle down' id='1down'></div></td>
</tr>
<tr>
<td colspan='<?php if ($fu == True) { echo 4; } else { echo 3; } ?>'>
<img src='assets/unlock.jpg'>
</td>
</tr>
</table>
</div>
<form action='success.php' method='POST'>
<!--Don't even think about it...-->
<input type='hidden' name='try1' id='try1'>
<input type='hidden' name='try10' id='try10'>
<input type='hidden' name='try100' id='try100'>
</form>
<!-- Just to be GDPR compliant (kinda...) -->
<footer>This page uses cookies, live with it...</footer>
</body>
</html>