 <p>you need to check if you are posting all the "posting fields".. some sites use security tokens or sessions ids to prevent bots from logging on their sites. anyway, you need to install Live HTTP headers firefox extension. open it and try to login manually, then see whats being posted actually when you press login button. after you get the values. add then to the first function and test again.</p>