Once you have validated the user's credentials, and updated the sessions you'd set a redirection header for the same page before any html is outputted.
PHP Code:
<?php
// check user credentials
// log them in
// they're now logged in, let's redirect them to this same page
header("Location: http://example.com/myloginpage.php");
?>
The better solution would probably to separate the script into two different pages. This depends on the setup though. I don't know enough about your situation to recommend one thing over another.
Bookmarks