I want when entered in input box, page refresh according to the entered value.
Actually enter the number 2 when I refresh the page twice.
This is my code, however, my code runs only once.
<?php
if(isset($_POST['refresh-time'])){
$_SESSION['value'] = $_POST['refresh-time'];
for( $i = 0 ; $i < $_SESSION['value'] ; $i++ ){
$value = $_SESSION['value'];
$url = $_SERVER['REQUEST_URI'];
header("Refresh: $value ; URL=$url");
}
}
?>
<form class="form-inline" method="POST">
<div class="form-group">
<label for="text">referesh number</label>
<input type="text" class="form-control" name="refresh-time">
</div>
<button type="submit" class="btn btn-default"><i class="fa fa-pencil" ></i> apply</button>
</form>