$n = $_POST['number']; for ($n = 1, $f = 5; $f > 1; $f--) { $n *= $f; echo $n; }