If you have a custom page and users login via it, then in your php code you need to define where they end up after they login. If you are using the standard login.php page from vbulletin, then look up the function do_login_redirect to see how it works and what you need to do to redirect back to your custom page (I believe it looks up the location of the user in the session table, so you will need to make sure that your user has a valid session and your page location is set correctly).