First, to your question. The most simple is to use the header()
function to redirect to a page.
if ( !$email) {
header('Location: http://example.com/new_page.html' );
} else {
// Continue with code
}
Secondly, there is a whole lot of issues going on in that code. For example:
- Use PDO
- parameterize your query
- Your control statement should probably look like
if(!empty($_POST['name'])) {