Oh, I thought you were asking specifically about the redirect line. The entire code would look like this, assuming you are posting the form.
$_POST gives you an array of all the elements in your form. Similarily you can use $_GET if you your form method is GET. By using !empty() that is making sure the variable exists in the $_POST array and that is not "".