<form action="linedisplay.php" method="post">
Number of line to show:
<select name="lines">
<option value="30">30</option>
<option value="50">50</option>
</select>
</form>
linedisplay.php:
<?php
$lines_to_show = $_POST['lines'];
$mail_db = fopen("/path/to/mail.db", "r");
for($i = 0; $i < $lines_to_show; $i++) {
$lines .= fgets($mail_db);
}
echo $lines;
?>
Of course, edit it to do whatever you need.