Copy code The code is as follows:
//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');
?>
🎜>
global $_SGLOBAL;//Define global variables
//Registered user name
$rando_first_name = array(
'Where to shop',
'Tongqiong Forum',
'Taizhou Mom',
'7788 Hacker'
);
//Registered password
$rando_first_password = array(
'15032x ',
'103716',
'114517',
'1ggg17'
);
/*In order to ensure that the username and password can be matched, output the array lengths of the characters for comparison
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 username 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 there is no user
$_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
";
}else{
echo "The user you want to add has been added! ";
}
}
//Author: www.tongqiong.com
?>