This question has had me thinking all afternoon, as it could easily come up while traveling. I was thinking that there must be a way to do this without the forethought to install 'Lynx' ahead of time. After a bit of searching, I found the following at:
https://superuser.com/questions/132392/using-command-line-to-connect-to-a-wireless-network-with-an-http-login
You will have to look once at the source of the login form to find out the names of the user and password fields. As the authentication redirect all pages, use any URL to get that source:
curl http://www.google.com > login.html
For example, you'll find:
<form method="POST" action="http://my-public-provider.com/agree.php">
<input type="checkbox" name="agree" value="yes">I agree
<input type="submit" name="push" value="Send">
</form>
Then you can build your curl command to post your form information:
curl -d "agree=yes&push=Send" http://my-public-provider.com/agree.php