- 论坛徽章:
- 0
|
- function loginsubmit(frm)
- {
- if (frm.ekey.value=='无则不填')
- {
- frm.ekey.value='';
- }
- if (frm.sendpost)
- {
- frm.sendpost.disabled = true;
- }
- frm.method = "post";
- frm.action = (window.location.hostname.indexOf("big5.cmfu.com")<0) ? "/loginuser.asp" : "/www.cmfu.com/loginuser.asp";
- frm.submit();
- }
复制代码
难道form不是post到了www.cmfu.com/loginuser.asp吗?
为什么post过去后 没有显示出body内容?
- use LWP::UserAgent;
- use HTTP::Request::Common qw(POST);
- my %ua_option = (
- agent => "Mozilla/5.0",
- timeout => 180,
- );
- my $ua = LWP::UserAgent->new(%ua_option);
- my $url = 'http://www.cmfu.com/loginuser.asp'; # or 'https://...';
- my %form;
- $form{user_name} = 'thevoice';
- $form{pass_word} = '835170';
- $form{ekey}='';
- $form{user_type}=1;
- my $req = POST($url, [%form]);
- my $res = $ua->request($req);
- if ($res->is_success) {
- print $res->header("Content-Type") . "\n";
- print $res->status_line . "\n";
- print $res->code . "\n";
- print $res->header("Server") . "\n";
- print $res->content;
- } else {
- print $res->status_line . "\n";
- }
复制代码
用LWP::Simple取得的post form的代码
- <tr>
- <td align="right">用户名 <input type="text" name="user_name" size=8 maxlength=20 onFocus="this.select()" class=think> </td>
- <td align="right">密码 <input type="password" name="pass_word" size=8 maxlength=16 onFocus="this.select()" class=think> </td>
- <td id='etd' align="right">密宝密码 <input type="text" name="ekey" size=8 maxlength=8 onFocus="this.select()" class=think value="无则不填"> </td>
- <td align="right"><a href="https://ekey.poptang.com/challengecode.asp" target="_blank">挑战码</a> 3541 <input type="hidden" name="user_type" value="1"></td>
- <td align="right"> <input TYPE="checkbox" NAME="selected" onClick="checkstatus(this.form)" value="yes">保持一月 <input type="submit" value="登录书屋" style="color:blue" class=stbtm name=sendpost onclick="loginsubmit(this.form);"> <input type="button" value="新用户注册" class=stbtm onclick="javascript:location.href='/reg_start.asp'" style='color:red'> </td>
- </tr>
复制代码
我是不是少post了哪个字段? |
|