Start by removing the output buffering. Its not needed (ever really), and here you don't have any previous output so its not necessary.
You sure you are storing passwords without any type of hashing? If so, don't. If you are hashing, then you are not pulling any results, and therefore you have no redirect (or output) so it doesn't go anywhere.
Also change this:
PHP Code:
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
To this:
PHP Code:
if (ini_get('magic_quotes_gpc'))
{
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
}
Stripslashes should only occur if magic quotes are enabled. Otherwise I couldn't make my username \\FouLu\C$.
I'd take the querystring off that redirect and throw it into the sessions as well.