| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1762 人关注过本帖
标题:[求助]请大虾帮我看下这个注册程序到底问题出在哪里?
只看楼主 加入收藏
rock1_23
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2007-2-5
收藏
 问题点数:0 回复次数:4 
[求助]请大虾帮我看下这个注册程序到底问题出在哪里?
sub register_mode {
    my $user_reg = shift;
    my $strPassword = shift;
    $user_reg = 'testsf' . time() . '?' unless $user_reg;
    $strPassword = '123456' unless $strPassword;
    my $total = 1;
    $total = 999 if $user_reg =~ m{\?};
   
    for my $n (1..$total) {
        my $strUsername = $user_reg;
        my $f_n = sprintf("%03d", $n);
        $strUsername =~ s{\?}{$f_n}gis;        
        my $backurl = 'http://cqbbs.';
        my $question2 = '第一个宠物的名字';
        my $strAnswer ='1234567890';
        my $Gender = '男';
        my $strEmail = rock1_23@';
        my $strProvince = '上海';
        my $strCity = '上海';
        my $strDistrict = '闵行';
        my $ua = LWP::UserAgent->new;
        $ua->cookie_jar({});
        #my $r1 = $ua->get('http://passport.');
        #print Dumper($r1);
        my_print "准备注册$strUsername\n" if VERBOSE;
        my $r2 = $ua->get('http://passport.', Referer => 'http://passport.');
        open(FILE, '>', 'ipc/zhuce.txt');        
        close FILE;
        open(FILE, '>', 'ipc/zhuce.jpg');
        binmode FILE;
        print FILE $r2->content;
        close FILE;
        my_print "等待银币验证码识别\n" if VERBOSE;
        my $text = '';
        open(FILE, '<', 'ipc/zhuce.txt');
        while (1) {
                              
            $text = <FILE>;
            $text =~ s{\r|\n}{}g if defined $text;
            unless ($text) {
               # my_print "." if VERBOSE;
                sleep 1;
                next;
            }
            if ($text eq 'cancel') {
                my_print "用户取消验证码\n" if VERBOSE;
                my_exit;   
            } else {
                last;
            }                    
        }
        close FILE;
        unless ($text) {
            my_print "验证码有误\n" if VERBOSE;
            next;
        }
        my_print "得到输入验证码$text\n" if VERBOSE;
        
        
        my $response = $ua->post('http://passport.', Referer => 'http://passport.',
        Content => [
            backurl => 'http://cqbbs.',
            projname => '',
            strUsername => $strUsername,
            strPassword => $strPassword,
            strPasswordConfirm => $strPassword,
            question2 => $question2,
            strQuestion => '',
            strAnswer => $strAnswer,
            Gender => $Gender,
            strEmail => $strEmail,
            strProvince => $strProvince,
            strCity => $strCity,
            strDistrict => $strDistrict,
            agree => 'on',
            vcode => $text,
            'submit.x'=>24,
            'submit.y'=>7
        ],
        );

        if ($response->content =~ m{您已成功申请了搜房通行证}) {
            my_print "成功注册$strUsername\n" if VERBOSE;
            open(FILE2, '>>', 'user_get.txt');
            print FILE2 "$strUsername/$strPassword\n";
            close FILE2;
        } else {
            my_print "不能注册$strUsername\n" if VERBOSE;
        }
    }
    #    print Dumper($response);
    #sleep 100;
    close FILE2;
}




注册连接: http://passport.
搜索更多相关主题的帖子: 注册 
2008-08-15 22:45
rock1_23
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2007-2-5
收藏
得分:0 
顶一下~!
2008-08-18 22:31
anaranjado
Rank: 1
来 自:法兰西
等 级:新手上路
威 望:1
帖 子:24
专家分:0
注 册:2008-8-5
收藏
得分:0 
楼主,不是我说,我咋看不明白你在写啥呢?

你这个是个函数么?
2008-08-19 07:17
bobo364
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2008-10-7
收藏
得分:0 
好象不是php代码吧
好象不是php代码吧
2008-10-08 15:33
快速回复:[求助]请大虾帮我看下这个注册程序到底问题出在哪里?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017313 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved