curl-users
Problem logging into website
Date: Thu, 25 Oct 2012 13:55:04 -0400
Hi all,
Novice curl user here, hoping I could get some help. I need to write a
script to log into http://www.ghcommunity.info/maintenance/ but I
can't get it to work.
The <form> section of the page's source code looks like this:
<form action="/maintenance/login/login" method="post">
<table width="300" border="0" cellpadding="0" cellspacing="0"
style="margin: 0 auto;">
<tr valign="top">
<td width="100" height="24">
<div align="left">Suite Number:</div>
</td>
<td width="200">
<div align="left">
<input id="user[login]" maxlength="15" name="user[login]"
size="20" type="text" value="" />
</div>
</td>
</tr>
<tr valign="top">
<td width="100">
<div align="left">Password: </div>
</td>
<td width="200">
<div align="left">
<input id="user[password]" maxlength="15" name="user[password]"
size="20" type="password" value="" />
</div>
</td>
</tr>
</table>
<p>
<input class="smallbutton" type="submit" value="Login" />
</p>
</form>
Based on that I tried
curl -F "user[login]=XXX&user[password]=YYY"
http://ghcommunity.info/maintenance/login/login
But it just gave me a message that I was being redirected to the login page.
Later, I tried the trick of copying the source to a local file and
changing POST to GET to see what the resulting URL looked like, and I
found that it used "%5B" and "%5D" instead of "[" and "]", so I tried
this:
curl -F "user%5Blogin%5D=XXX&user%5Bpassword%5D=YYY"
http://ghcommunity.info/maintenance/login/login
In this case, though, it just returns an error page, the same as I get
in my browser if I try to navigate directly to
http://ghcommunity.info/maintenance/login/login.
Any ideas what might be the problem?
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-10-25