Redirect page

Redirect page

My problem now is that I am programming a login module and what I need is that when the login and password be wrong to show an error message on a <div>, but when the login and password be right open a new page without loading it on a <div>.