Not sure how useful this is, but interesting. It will output all the prime numbers between the inputted start and end numbers.
PHP Code:
<form action="#" method="get">
<input name="start" type="text" />
<input name="end" type="text" />
<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.' ';
}
?>