开发者

curl login script to a javascript page

Hy all.

I try to use curl script to login a page with a javascript submit process with out any luck...

Can someone help me ?

Here is the form :

<li class="login_title_right"></li>
</ul>
<div class="content login_content">
<ul class="login_blank"></ul>
<ul class="login_ul_1">
<li class="login_li_1"><span>Username</span></li>
<li class="login_li_2">
<input type="text" class="username" name="Username" id="Frm_Username">开发者_C百科;
</li>
</ul>
<ul class="login_blank"></ul>
<ul class="login_ul_1">
<li class="login_li_1"><span>Password</span></li>
<li class="login_li_2">
<input type="password" class="password" name="Password"  id="Frm_Password">

</li>
<li class="login_li_3">
<input class="login" type="submit"  id="LoginId"  value="Login"  onclick="dosubmit()">
</li>
</ul>

Transform that plz in a curls login script . The username to login is "admin" and password is "xxx123"


Try this

curl -b cookies.txt -c cookies.txt --data "Username=admin&Password=xxx123&Login=Login" [urlthatyour form sumbits]

You need cookies if you want to make another curl request after logging in. the session id in cookies will help next curl request authorized.

If you don't want cookies you can use

curl --data "Username=admin&Password=xxx123&Login=Login" [url that your form submits]

typically form action will be your url.

Try to add name to your submit button. I used id for login here. Never tried, not sure if it works but name should work.


You can't use it directly on the page. You would need to find out what page the script requests to (or the action value of the form).

As you haven't provided the form tags or the script's contents, we can't help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜