mirror of
https://github.com/FranP-code/Visit-counter.git
synced 2025-10-12 23:52:54 +00:00
Añadida la funcionalidad a la pagina para definir la cantidad de visitas
This commit is contained in:
20
definer.php
Normal file
20
definer.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
$visitas = htmlspecialchars($_POST['visitas']);
|
||||
|
||||
function backToLife() {
|
||||
header('Location: ./definer.html');
|
||||
}
|
||||
|
||||
if (!isset($visitas)) {
|
||||
backToLife();
|
||||
}
|
||||
|
||||
if ($visitas >= 0 && $visitas <= 9999) {
|
||||
file_put_contents('./visits.txt', $visitas - 1);
|
||||
header('Location: ./index.php');
|
||||
} else {
|
||||
backToLife();
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,6 @@
|
||||
* {
|
||||
margin: 0;
|
||||
|
||||
user-select: none;
|
||||
}
|
||||
html, body {
|
||||
height: 100%;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
* {
|
||||
margin: 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
body {
|
||||
|
||||
@@ -1 +1 @@
|
||||
57
|
||||
112
|
||||
Reference in New Issue
Block a user