Actually wouldn't the "exit" be in the "if" not the "else"
if ( empty($top1) || empty($top2) ){
echo "Please enter all fields<br><br>";
exit;
}
else{
echo "Thank you! <br>";
echo "You entered:<br>$top1<br>$top2<br><br>";
echo "<a href="index.php">Home</a>";
}
And if you only wanted the fields that they typed in display then you can use this code
if ( !empty($top1) || !empty($top2) ){
echo "You entered:<br>$top1<br>$top2<br><br>";
echo "<a href="index.php">Home</a>";
}
Notice the exclamination point.