Im trying to login to my useraccount on a site i use to download files from so i can automatically grab the file without me having to visit the site.
This is
You should send via POST all data that the orignal form is sending. So you are missing autologin=1&userlogin=Login in your $postdata.
autologin=1&userlogin=Login
$postdata
$postdata = "username=$username&userpass=$password&autologin=1&userlogin=Login";