UCenter bulk adds the user's php code

  • 2020-05-19 04:22:46
  • OfStack

 
<? 
// The author :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;// Defining global variables  
// The registered user name  
$rando_first_name = array( 
' Where is shopping ', 
' With poor BBS ', 
' Taizhou mother ', 
'7788 hackers ' 
); 
// Password for registration  
$rando_first_password = array( 
'15032x', 
'103716', 
'114517', 
'1ggg17' 
); 
/* To ensure that the username and password are numbered, the array length of the output words is compared  
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); 
// Query whether this user name already exists  
$sql_username = "select username from uc_members where username='".$username."'"; 
$s_name = $_SGLOBAL['db']->fetch_array($_SGLOBAL['db']->query($sql_username)); 
// If there is no user with the same name  
if($username != $s_name['username']){// If it doesn't exist  
$_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 " The user you want to add has been added! "; 
} 
} 
// The author :www.tongqiong.com 
?> 
</body> 
</html> 

Related articles: