Ok, I'm able to login with my script and get to the page I needed to get to.
Here are the curl options that I needed to set.
curl_setopt($ch,CURLOPT_POSTFIELDS,$postdata);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_COOKIEFILE,"cookie.txt");
curl_setopt($ch,CURLOPT_COOKIEJAR,"cookie.txt");
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1 );
curl_setopt($ch,CURLOPT_MAXREDIRS,100);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1 );
Get the $postdata that you need by using httpliveheaders plugin for Firefox.
S.