I think the problem you are facing is, that the original form contains two additional hidden fields:
<input type="hidden" name="sid" value="7703a705e2d9971b1eae77b1f3ff61d6">
<input type="hidden" name="redirect" value="index.php">
The redirect field shouldn't be the problem.
For the sid field i myself assume two functionalities. It could be a hash to prevent XSS or it is just the sid that the login will be assigned to. But i think the second one will be more reasonable because of the chosen name :)
So what you have to do before you get your form working is to fetch the login formular with curl, extract the sid and add it to your own form as a hidden field.
Let me know if that helps you.