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();
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user