You're only posting a username and password. Maybe you should consider using an http class rather than doing it all manually.