The way you've got this login system set up seems a bit strange to me, I'm having trouble understanding how you're trying to work this. Apparently you've already got they're username and you're asking them to submit a form to determine where they go from here?
In your browser when it's displaying this login form, view the page source and tell me what it's showing after action="
Cannot login as specific page
Moderators: egami, macek, gesf
1). breaking the form tag as you have did is not required. you can start the <form tag just before the word "action".
2). Please print this, echo $addurl . htmlspecialchars($_SESSION['site_id']) and decide if it is using the correct url to proceed after login.
2). Please print this, echo $addurl . htmlspecialchars($_SESSION['site_id']) and decide if it is using the correct url to proceed after login.
Check your admin file path.