The notices would be "normal" if either there is a logic error or if you are being "sloppy" in a sense in referring to $_POST elements when they may not necessarily be set. (Don't take the term "sloppy" personally, it's just the only adjective I could think of; and believe me, a lot of people do it.)
Suppose in the preceding example that $ampm comes from $POST['ampm'], but that depending on the logic flow and user actions, it may or may not be set yet. You then could do something like the following to deal with either situation:
$ampm = (isset($_POST['ampm'])) ? $_POST['ampm'] : '';
foreach(array('AM', 'PM') as $value)
{
$selected = ($ampm == $value) ? ' selected="selected"' : '';
$display .= "<option value='$value'$selected>$value</option>\n";
}