Home > php教程 > php手册 > Discuz 6.0+ 批量注册用户名

Discuz 6.0+ 批量注册用户名

WBOY
Release: 2016-06-13 12:22:15
Original
879 people have browsed it

1.将adduser.php复制到discuz根目录下;
/--adduser.php内容如下--/
php
require_once './include/common.inc.php ';
//注册的名字
$user_list = file('./username.txt ');
//注册的密码
$a = "12345678";
$pwd = md5($a);
// 注册用户数(建议一万一下)
$member_num = count($user_list);
//设置运行时间
set_time_limit(3600 );
for($i=0;$i$username = $user_list[$i];
$db->query("REPLACE INTO {$tablepre}members (username, password,regdate) VALUES ('$username', '$pwd','1175655041')");
$uid = $db->insert_id();
$db->query("INSERT INTO {$tablepre}memberfields (uid) VALUES ('$uid')");
echo $i.':'.$username."__完成
";
?>
2.手工采集用户名,也放于discuz根目录下
/--username.txt内容如下--/
mouse365
大菜鸟
SHAM
确保一行一个即可!
PS:关于用户名的采集可以采用如下方法(以 http://www.freediscuz.net/bbs/member.php?action=list 为例)
1. 打开网址 http://www.freediscuz.net/bbs/member.php?action=list ;
2.复制以下信息保存到username.txt
admin 1 2003-6-7 2008-12-22 15:06 127 421
theoldmemory 3 2003-6-8 2004-8-8 23:15 0 0
lauraych 4 2003-6-9 2007-9-28 16:36 0 0
3.利用UltraEdit等编辑器执行正则匹配去掉无用信息
admin
theoldmemory
lauraych

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template