| <form action="#" method="get"> |
| <input name="start" type="text" value="<?php echo isset($_GET) ? $_GET['start'] : '' ?>" /> |
| <input name="end" type="text" value="<?php echo isset($_GET) ? $_GET['end'] : '' ?>" /> |
| <input name="submit" type="submit" value="Go!" /> |
| </form> |
| |
| <?php |
| for ($i = $_GET['start']; $i <= $_GET['end']; $i++) |
| { |
| if ($i % 2 != 1) |
| continue; |
| |
| $d = 3; |
| $x = sqrt($i); |
| |
| while ($i % $d != 0 && $d < $x) |
| $d += 2; |
| |
| if ((($i % $d == 0 && $i != $d) * 1) == 0) |
| echo $i.' '; |
| } |