色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

UCenter 批量添加用戶的php代碼

復(fù)制代碼 代碼如下:
<?
//作者:www.tongqiong.com
//header("content-type:text/html; charset=utf-8");
//include_once("include/config.php");
//include_once("include/db_mysql.inc.php");
////include_once("include/n_public_function.php");
//$db = new DB_MYSQL("localhost","dbh218710","root","123");
include_once('./common.php');
include_once(S_ROOT.'./data/data_magic.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<?
global $_SGLOBAL;//定義全局變量
//注冊的用戶名
$rando_first_name = array(
'哪里購物',
'同窮論壇',
'臺州媽媽',
'7788黑客'
);
//注冊的密碼
$rando_first_password = array(
'15032x',
'103716',
'114517',
'1ggg17'
);
/*為了確保用戶名和密碼能對上號,輸出個字的數(shù)組長度進(jìn)行比較
echo count($rando_first_name);
echo "______";
echo count($rando_first_password);
exit;
*/
for($i=0;$i<count($rando_first_name);$i++){
$username = $rando_first_name[$i];
$pwd1 = $rando_first_password[$i];
$salt = substr(uniqid(rand()), -6);
$pwd = md5(md5($pwd1).$salt);
//查詢是否已存在此用戶名
$sql_username = "select username from uc_members where username='".$username."'";
$s_name = $_SGLOBAL['db']->fetch_array($_SGLOBAL['db']->query($sql_username));
//如果不存在重名的用戶
if($username != $s_name['username']){//如果不存在
$_SGLOBAL['db']->query("INSERT INTO uc_members (username, password,regdate,salt)
VALUES ('$username', '$pwd','".mktime()."','$salt')");
$sql = "select uid from uc_members where username='".$username."'";
$_SGLOBAL['db']->query($sql);
$uuu = $_SGLOBAL['db']->fetch_array($_SGLOBAL['db']->query($sql));
echo $uuu['uid'];
$_SGLOBAL['db']->query("INSERT INTO uc_memberfields (uid)
VALUES ('".$uuu['uid']."')");
echo $username."success<br/>";
}else{
echo "您要添加的用戶已添加!";
}
}
//作者:www.tongqiong.com
?>
</body>
</html>

php技術(shù)UCenter 批量添加用戶的php代碼,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 阿图什市| 大港区| 周口市| 石泉县| 宣城市| 铁岭县| 阳曲县| 荆州市| 华亭县| 鞍山市| 乡宁县| 翁牛特旗| 靖宇县| 木兰县| 滦南县| 乌审旗| 茌平县| 尖扎县| 临城县| 常宁市| 阿拉善左旗| 吴旗县| 郑州市| 凭祥市| 宁都县| 华阴市| 浮山县| 七台河市| 雅安市| 佛教| 舟曲县| 兰坪| 简阳市| 金塔县| 华阴市| 柳江县| 永春县| 崇义县| 通海县| 周宁县| 新巴尔虎左旗|